- /* x-axis limits of the curve, in window space coordinates */
-
- Duple w1 = item_to_window (Duple (_points.front().x, 0.0));
- Duple w2 = item_to_window (Duple (_points.back().x, 0.0));
-
- /* clamp actual draw to area bound by points, rather than our bounding box which is slightly different */
-
- context->save ();
- context->rectangle (draw.x0, draw.y0, draw.width(), draw.height());
- context->clip ();
-
- /* expand drawing area by several pixels on each side to avoid cairo stroking effects at the boundary.
- they will still occur, but cairo's clipping will hide them.
- */
-
- draw = draw.expand (4.0);
-
- /* now clip it to the actual points in the curve */
-
- if (draw.x0 < w1.x) {
- draw.x0 = w1.x;
- }
-
- if (draw.x1 >= w2.x) {
- draw.x1 = w2.x;
- }
-