X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooTrackView.java;fp=MooTrackView.java;h=0c48df37ad736b7ccc2d2dbc6c3c9545c498f7d4;hp=f7e8335bf365748478972feff97c7ce4fb879f53;hb=ae0bb1ddc2361a9c7f08579488870f0b99b14cb6;hpb=8b3ebfce3014e0edf2a0b0669981fcf583a36feb diff --git a/MooTrackView.java b/MooTrackView.java index f7e8335..0c48df3 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -132,8 +132,10 @@ public class MooTrackView extends JPanel { // Calculates coordinates. x = insets.left; - y = insets.top + Math.round(mn.getTick() / ticksPerSixteenth) * NOTE_HEIGHT; - height = (mn.getDuration() / ticksPerSixteenth) * NOTE_HEIGHT; + y = insets.top + (int)((mn.getTick() * NOTE_HEIGHT) / ticksPerSixteenth); + height = (mn.getDuration() * NOTE_HEIGHT) / ticksPerSixteenth; + System.out.println("y=i(" + insets.top + ")+t(" + mn.getTick() + ")/s(" + ticksPerSixteenth + ") *n(" + NOTE_HEIGHT + ") = " + y); + System.out.println("h=t(" + mn.getDuration() + ")/s(" + ticksPerSixteenth + ") *n(" + NOTE_HEIGHT + ") = " + height); if (height == 0) height = NOTE_HEIGHT; r = new Rectangle(x, y, NOTE_WIDTH, height);