From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/win32u/dibdrv/graphics.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c index 36fe965c4b6..1554f8415d0 100644 --- a/dlls/win32u/dibdrv/graphics.c +++ b/dlls/win32u/dibdrv/graphics.c @@ -216,11 +216,14 @@ static unsigned int generate_ellipse_top_half( const DC *dc, const RECT *rect, P * This point is not on the ellipse axis, but that doesn't matter for our * algorithm. We will take this set of points and rotate it 180 degrees * to get the opposite side. */ - x = GDI_ROUND( center_x - sqrt(d / a) ) - center_x; + if (!height || !width) + x = GDI_ROUND( center_x ) - center_x; + else + x = GDI_ROUND( center_x - sqrt(d / a) ) - center_x; y = GDI_ROUND( center_y ) - center_y; start_x = x;
- while (y > 0 || (y == 0 && x != -start_x)) + do { double dx = (b * x + c * y); double dy = -(a * x + b * y); @@ -274,7 +277,8 @@ static unsigned int generate_ellipse_top_half( const DC *dc, const RECT *rect, P if (fabs(sigma2) > fabs(sigma1)) y -= y_inc; } - } + } while (y > 0 || (y == 0 && x != -start_x)); + return pos; }