diff options
author | nick_m <mainsbridge@gmail.com> | 2016-05-25 12:31:17 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:17 +1000 |
commit | 2d31fa7bb10c7d0dfa7950e35ef61b00390b4546 (patch) | |
tree | 024e51c2bfb826df972d510a1bdc9761ccb19c9e /libs/canvas/framed_curve.cc | |
parent | 6e97f40d08d74d205f2ca17d82b3191a8b225124 (diff) |
Tempo ramps - finally fix flicker in framed curve.
Diffstat (limited to 'libs/canvas/framed_curve.cc')
-rw-r--r-- | libs/canvas/framed_curve.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/canvas/framed_curve.cc b/libs/canvas/framed_curve.cc index 295deb8dad..6bd2f740b0 100644 --- a/libs/canvas/framed_curve.cc +++ b/libs/canvas/framed_curve.cc @@ -187,22 +187,25 @@ 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 - 1; ++idx) { + for (Points::size_type idx = 0; idx < n_samples; ++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; --idx) { + for (Points::size_type idx = n_samples; idx > left + 2; --idx) { window_space = item_to_window (Duple (samples[idx].x, 0.0)); if (window_space.x <= draw.x1) break; right = idx; } + window_space = item_to_window (*_points.begin()); + context->move_to (window_space.x, window_space.y); /* draw line between samples */ window_space = item_to_window (Duple (samples[left].x, samples[left].y)); - context->move_to (window_space.x, window_space.y); - for (uint32_t idx = left + 1; idx < right; ++idx) { + context->line_to (window_space.x, window_space.y); + + for (uint32_t idx = left; idx < right; ++idx) { window_space = item_to_window (Duple (samples[idx].x, samples[idx].y), false); context->line_to (window_space.x, window_space.y); } |