// 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);