Commit ed1bb9f

Richard Ziegler committed on
Fix sample draw mouse precision with round instead of trunc/floor
commit ed1bb9f6eb3bf62b1faa69b115a34fefabc18f48 parent 3cb038d
1 changed files +1−1
Modifiedtracker.pas +1−1
@@ -2565,7 +2565,7 @@ begin
2565 X := EnsureRange(X, 0, WaveEditPaintBox.Width); 2565 X := EnsureRange(X, 0, WaveEditPaintBox.Width);
2566 Y := EnsureRange(Y, 0, WaveEditPaintBox.Height); 2566 Y := EnsureRange(Y, 0, WaveEditPaintBox.Height);
2567 if DrawingWave then begin 2567 if DrawingWave then begin
2568 Idx := EnsureRange(Trunc((X / WaveEditPaintBox.Width)*High(TWave)), Low(TWave), High(TWave)); 2568 Idx := EnsureRange(Round((X / WaveEditPaintBox.Width)*High(TWave)), Low(TWave), High(TWave));
2569 CurrentWave^[Idx] := EnsureRange(Trunc((Y / WaveEditPaintBox.Height)*$F), 0, $F); 2569 CurrentWave^[Idx] := EnsureRange(Trunc((Y / WaveEditPaintBox.Height)*$F), 0, $F);
2570 UpdateHexWaveTextbox; 2570 UpdateHexWaveTextbox;
2571 WaveEditPaintBox.Invalidate; 2571 WaveEditPaintBox.Invalidate;