From c8924f4133c1e76349b12bcc1e7002309cfaf55f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 11 Sep 2024 17:19:05 -0600 Subject: [PATCH] fix lollipop drawing Cairo coordinate/argument limits are much smaller than the canvas. Trying to clip to a gigantic rectangle throws cairo into a weird state, so make sure we only clip to a part an exposed area --- libs/canvas/lollipop.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/canvas/lollipop.cc b/libs/canvas/lollipop.cc index 9aa3e7bd75..5d9dca51c5 100644 --- a/libs/canvas/lollipop.cc +++ b/libs/canvas/lollipop.cc @@ -84,15 +84,15 @@ Lollipop::render (Rect const & area, Cairo::RefPtr context) cons /* the circle: clip to avoid weirdness at top and bottom of parent */ if (bounding_parent) { - context->save (); Rect b (bounding_parent->item_to_window (bounding_parent->bounding_box())); + b = b.intersection (area); + context->save (); context->rectangle (b.x0, b.y0, b.width(), b.height()); context->clip(); } context->arc (p.x, p.y, _radius, 0.0 * (M_PI/180.0), 360.0 * (M_PI/180.0)); - if (fill()) { setup_fill_context (context); if (outline()) {