From a17be10094cf63d98b1226824e0f4da0eb00a86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 3 Jun 2006 14:14:59 +0000 Subject: [PATCH] * "divisions" could be lower than 1. This fixes bug #510. * Moved expensive computation out of the max_c() macro. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17709 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 6b84d7ed5d..6b02577069 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -853,10 +853,13 @@ Painter::DrawEllipse(BRect r, bool fill) const float xRadius = r.Width() / 2.0; float yRadius = r.Height() / 2.0; - BPoint center(r.left + xRadius, - r.top + yRadius); + BPoint center(r.left + xRadius, r.top + yRadius); - int32 divisions = (int32)max_c(12, (xRadius + yRadius + 2 * fPenSize) * PI / 2); + int32 divisions = (int32)((xRadius + yRadius + 2 * fPenSize) * PI / 2); + if (divisions > 12) + divisions = 12; + if (divisions < 1) + divisions = 1; if (fill) { agg::ellipse path(center.x, center.y, xRadius, yRadius, divisions);