From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/gdi32/tests/bitmap.c | 23 ++++++++++++++++++++++- dlls/win32u/dibdrv/graphics.c | 4 ++-- 2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 47a2ac886f7..2284f1f5e23 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -6039,7 +6039,28 @@ static void test_arcs(void) { int colour = bits[(dib_height - 1 - y) * dib_width + x];
- if (x < 10 || y < 10 || x >= 40 || y >= 25) + if (x < 10 || y < 10 || x >= 40 || y >= 25 + || ((x == 10 || x == 39) && (y == 10 || y == 24))) /* corners */ + ok(!colour, "Got unexpected colour %08x at (%u, %u).\n", colour, x, y); + + if (((x >= 13 && x < 37) && (y == 10 || y == 24)) /* top/bottom edge */ + || ((y >= 14 && y < 21) && (x == 10 || x == 39))) /* left/right edge */ + ok(colour == 0x111111, "Got unexpected colour %08x at (%u, %u).\n", colour, x, y); + } + } + + /* Same round rect, but with the ellipse width and height inverted. */ + memset( bits, 0, dib_width * dib_height * 4 ); + RoundRect( dc, 10, 10, 40, 25, -6, -9 ); + + for (unsigned int y = 9; y <= 26; ++y) + { + for (unsigned int x = 9; x <= 41; ++x) + { + int colour = bits[(dib_height - 1 - y) * dib_width + x]; + + if (x < 10 || y < 10 || x >= 40 || y >= 25 + || ((x == 10 || x == 39) && (y == 10 || y == 24))) /* corners */ ok(!colour, "Got unexpected colour %08x at (%u, %u).\n", colour, x, y);
if (((x >= 13 && x < 37) && (y == 10 || y == 24)) /* top/bottom edge */ diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c index c629a59ae1b..21085a1d84a 100644 --- a/dlls/win32u/dibdrv/graphics.c +++ b/dlls/win32u/dibdrv/graphics.c @@ -1581,8 +1581,8 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, --bottom; }
- ellipse_width = min( ellipse_width, abs( right + 1 - left )); - ellipse_height = min( ellipse_height, abs( bottom + 1 - top )); + ellipse_width = min( abs( ellipse_width ), abs( right - left ) + 1 ); + ellipse_height = min( abs( ellipse_height ), abs( bottom - top ) + 1 );
SetRect( &arc_rect, 0, 0, ellipse_width, ellipse_height ); /* We are drawing four arcs, but the number of points we will actually use