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:
parent
0399cd9d02
commit
c8924f4133
@ -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 */
|
/* the circle: clip to avoid weirdness at top and bottom of parent */
|
||||||
|
|
||||||
if (bounding_parent) {
|
if (bounding_parent) {
|
||||||
context->save ();
|
|
||||||
Rect b (bounding_parent->item_to_window (bounding_parent->bounding_box()));
|
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->rectangle (b.x0, b.y0, b.width(), b.height());
|
||||||
context->clip();
|
context->clip();
|
||||||
}
|
}
|
||||||
|
|
||||||
context->arc (p.x, p.y, _radius, 0.0 * (M_PI/180.0), 360.0 * (M_PI/180.0));
|
context->arc (p.x, p.y, _radius, 0.0 * (M_PI/180.0), 360.0 * (M_PI/180.0));
|
||||||
|
|
||||||
|
|
||||||
if (fill()) {
|
if (fill()) {
|
||||||
setup_fill_context (context);
|
setup_fill_context (context);
|
||||||
if (outline()) {
|
if (outline()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user