#else
static const bool show_bg_fades = true;
#endif
-
+
XFadeCurve::XFadeCurve (Canvas* c)
: Item (c)
, points_per_segment (32)
Points::size_type left = 0;
Points::size_type right = c.n_samples - 1;
+ assert (left < right);
// we should really really do a binary search rather than iterate
for (Points::size_type idx = 0; idx < c.n_samples - 1; ++idx) {
left = idx;
window_space = item_to_window (Duple (c.samples[idx].x, 0.0), false);
if (window_space.x >= area.x0) break;
}
- for (Points::size_type idx = c.n_samples; idx >= left;) {
- --idx;
+ for (Points::size_type idx = c.n_samples; right > left;) {
+ if (--idx <= left) break;
window_space = item_to_window (Duple (c.samples[idx].x, 0.0), false);
if (window_space.x <= area.x1) break;
right = idx;
if (IS_START || show_background_fade) {
set_source_rgba (context, IS_START ? _outline_color : outline_shaded);
context->set_line_width (IS_START ? 1.0 : .5);
-
+
context->begin_new_path ();
context->append_path (*path_in);
context->stroke();