diff options
author | Robin Gareus <robin@gareus.org> | 2019-07-29 03:55:31 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-07-29 03:56:35 +0200 |
commit | 7b92f54929315654f0a5ac3417c54d5592227870 (patch) | |
tree | 81f3cf1689b3f64da2668780899376c359ab277a /libs/waveview/wave_view.cc | |
parent | a582b24fcddea0fc55b31dd567982227c5e3c890 (diff) |
Fix random off-by-one issue when vertically zooming a waveform
To mitigate concurrent rendering, the waveform cache adds a random
range of pixels centered around the visible waveform.
Alignment is using integer half_width = width_samples / 2;
This always aligns the left-edge to the left-most cairo-pixel.
This fixes an issue with moving moiree patterns in waveforms when
zooming vertically (which invalidates the cache and uses a
different random number of pixels),
Diffstat (limited to 'libs/waveview/wave_view.cc')
-rw-r--r-- | libs/waveview/wave_view.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/waveview/wave_view.cc b/libs/waveview/wave_view.cc index 7b7f7c28eb..938e85fd2a 100644 --- a/libs/waveview/wave_view.cc +++ b/libs/waveview/wave_view.cc @@ -1159,8 +1159,8 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons double x = self.x0 + image_origin_in_self_coordinates; double y = self.y0; context->user_to_device (x, y); - x = round (x); - y = round (y); + x = floor (x); + y = floor (y); context->device_to_user (x, y); /* the coordinates specify where in "user coordinates" (i.e. what we |