From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/win32u/dibdrv/graphics.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c index 5f01d9e68e4..43a43a6f9bd 100644 --- a/dlls/win32u/dibdrv/graphics.c +++ b/dlls/win32u/dibdrv/graphics.c @@ -1571,7 +1571,7 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, dibdrv_physdev *pdev = get_dibdrv_pdev( dev ); DC *dc = get_physdev_dc( dev ); RECT rect, arc_rect; - POINT rect_center, *points, *top_points; + POINT reflect, *points, *top_points; int count, max_points; BOOL ret = TRUE; HRGN outline = 0, interior = 0; @@ -1625,9 +1625,10 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, if (count * 2 > max_points) ERR( "point count %u * 2 exceeds max points %u\n", count, max_points );
- rect_center.x = (rect.left + rect.right) / 2; - rect_center.y = (rect.top + rect.bottom) / 2; - lp_to_dp( dc, &rect_center, 1 ); + /* See get_arc_points() on the construction of "reflect". */ + lp_to_dp( dc, (POINT *)&rect, 2 ); + reflect.x = rect.left + rect.right; + reflect.y = rect.bottom + rect.top;
if (dc->attr->arc_direction == AD_CLOCKWISE) { @@ -1635,8 +1636,8 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, { points[i].x = top_points[i].x; points[i].y = top_points[i].y; - points[count + i].x = rect_center.x * 2 - points[i].x; - points[count + i].y = rect_center.y * 2 - points[i].y; + points[count + i].x = reflect.x - points[i].x; + points[count + i].y = reflect.y - points[i].y; } } else @@ -1645,8 +1646,8 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, { points[i].x = top_points[count - 1 - i].x; points[i].y = top_points[count - 1 - i].y; - points[count + i].x = rect_center.x * 2 - points[i].x; - points[count + i].y = rect_center.y * 2 - points[i].y; + points[count + i].x = reflect.x - points[i].x; + points[count + i].y = reflect.y - points[i].y; } }