From 4ad808b67d63a3f631b6caebf72c25726eaef6ce Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 12 Jul 2020 13:11:11 +0200 Subject: [PATCH] app_server: Fix clipping computation in DrawArc The clipped rect was extended with the stroke width, and then the result was overwritten. Fixes #3130. --- src/servers/app/drawing/DrawingEngine.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/servers/app/drawing/DrawingEngine.cpp b/src/servers/app/drawing/DrawingEngine.cpp index 8d50de84a5..7824f72306 100644 --- a/src/servers/app/drawing/DrawingEngine.cpp +++ b/src/servers/app/drawing/DrawingEngine.cpp @@ -649,12 +649,11 @@ DrawingEngine::DrawArc(BRect r, const float& angle, const float& span, make_rect_valid(r); fPainter->AlignEllipseRect(&r, filled); - BRect clipped(r); if (!filled) - extend_by_stroke_width(clipped, fPainter->PenSize()); + extend_by_stroke_width(r, fPainter->PenSize()); - clipped = fPainter->TransformAndClipRect(r); + BRect clipped(fPainter->TransformAndClipRect(r)); if (clipped.IsValid()) { AutoFloatingOverlaysHider _(fGraphicsCard, clipped); @@ -682,9 +681,7 @@ DrawingEngine::FillArc(BRect r, const float& angle, const float& span, make_rect_valid(r); fPainter->AlignEllipseRect(&r, true); - BRect clipped(r); - - clipped = fPainter->TransformAndClipRect(r); + BRect clipped(fPainter->TransformAndClipRect(r)); if (clipped.IsValid()) { AutoFloatingOverlaysHider _(fGraphicsCard, clipped);