+ //image_origin_in_self_coordinates += _start_shift;
+ }
+
+ /* the image may only be a best-effort ... it may not span the entire
+ * range requested, though it is guaranteed to cover the start. So
+ * determine how many pixels we can actually draw.
+ */
+
+ double draw_width;
+
+ if (image_to_draw != _current_image) {
+ lci.release ();
+
+ /* the image is guaranteed to start at or before
+ * draw_start. But if it starts before draw_start, that reduces
+ * the maximum available width we can render with.
+ *
+ * so .. clamp the draw width to the smaller of what we need to
+ * draw or the available width of the image.
+ */
+
+ draw_width = min ((double) image_to_draw->image->get_width(), (draw_end - draw_start));
+
+
+ DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1 draw just %2 of %3 @ %8 (iwidth %4 off %5 img @ %6 rs @ %7)\n", name, draw_width, (draw_end - draw_start),
+ image_to_draw->image->get_width(), image_origin_in_self_coordinates,
+ image_to_draw->start, _region_start, draw_start));
+ } else {
+ draw_width = draw_end - draw_start;
+ DEBUG_TRACE (DEBUG::WaveView, string_compose ("use current image, span entire render width %1..%2\n", draw_start, draw_end));