summaryrefslogtreecommitdiff
path: root/libs/canvas
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-05-29 05:12:07 +1000
committernick_m <mainsbridge@gmail.com>2016-05-29 05:12:07 +1000
commit0d7f73cb2703fde460e75da37b1d4e483c14ad89 (patch)
tree57c884ed5c74f311f1b909d7247a506bb5ba143e /libs/canvas
parent22e031135ac2b81d8ac5d8d17d5a5a5b40281b6d (diff)
Hopefully finally fix tempo curve flickering.
Diffstat (limited to 'libs/canvas')
-rw-r--r--libs/canvas/framed_curve.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/canvas/framed_curve.cc b/libs/canvas/framed_curve.cc
index 6bd2f740b0..e8dee85c68 100644
--- a/libs/canvas/framed_curve.cc
+++ b/libs/canvas/framed_curve.cc
@@ -55,7 +55,7 @@ FramedCurve::set_points_per_segment (uint32_t n)
just need to schedule a redraw rather than notify the parent of any
changes
*/
- points_per_segment = n;
+ points_per_segment = max (n, (uint32_t) 3);
interpolate ();
redraw ();
}
@@ -187,13 +187,13 @@ FramedCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
Points::size_type left = 0;
Points::size_type right = n_samples;
- for (Points::size_type idx = 0; idx < n_samples; ++idx) {
+ for (Points::size_type idx = 0; idx < n_samples - 1; ++idx) {
window_space = item_to_window (Duple (samples[idx].x, 0.0));
if (window_space.x >= draw.x0) break;
left = idx;
}
- for (Points::size_type idx = n_samples; idx > left + 2; --idx) {
+ for (Points::size_type idx = n_samples; idx > left + 1; --idx) {
window_space = item_to_window (Duple (samples[idx].x, 0.0));
if (window_space.x <= draw.x1) break;
right = idx;