13
0

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
This commit is contained in:
Paul Davis 2024-09-11 17:19:05 -06:00
parent 0399cd9d02
commit c8924f4133

View File

@ -84,15 +84,15 @@ Lollipop::render (Rect const & area, Cairo::RefPtr<Cairo::Context> 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()) {