-
Bug
-
Resolution: Done
-
P2: Important
-
4.5.0
-
None
-
16af209f76074553c6f56b3cd0da3610a71410ab
Drawing a circle with QRasterPaintEngine::drawEllipse() results in
all kinds of funny lines if the width or height of the rectangle
exceeds about 30000 (presumably a 16 bit overflow problem somewhere
down drawEllipse_midpoint_i()/drawEllipsePoints()/...
The attached patch works around this (an actual fix would probably
have to be done further inside the code, if at all possible).
BTW: while looking at drawEllipse_midpoint_i() I saw that a*a and b*b
are used rather often (even inside the loops). Don't you think it would
save some CPU cycles if these were calculated once instead of multiple times?
PATCH:
— src/gui/painting/qpaintengine_raster.cpp.001 2009-02-25 22:32:35.000000000 +0100
+++ src/gui/painting/qpaintengine_raster.cpp 2009-04-20 14:29:29.439238971 +0200
@@ -3511,6 +3511,7 @@
ensurePen();
if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen)
(qpen_style(s->lastPen) == Qt::NoPen && !s->flags.antialiased)) + && qMax(rect.width(), rect.height()) < 30000 // drawEllipse_midpoint_i() fails beyond 16 bit #ifdef FLOATING_POINT_BUGGY_OR_NO_FPU && qMax(rect.width(), rect.height()) < 128 // integer math breakdown #endif |
---|