Commit cfd03d96 authored by Daniel Wendt's avatar Daniel Wendt Committed by Vitaly Lipatov

gdi32: fix for rotated ellipse

parent b6966665
......@@ -1535,6 +1535,23 @@ BOOL CDECL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
BOOL ret = TRUE;
HRGN outline = 0, interior = 0;
BOOL exclude_rotation_translation = FALSE;
XFORM old;
XFORM rotation_and_translation;
if (dc->attr->graphics_mode == GM_ADVANCED)
{
XFORM xf;
NtGdiGetTransform( pdev->dev.hdc, 0x203, &old );
xf = old;
if (xform_has_rotate_and_uniform_scale_and_shear( &xf ) &&
xform_decompose_rotation_and_translation( &xf, &rotation_and_translation ))
{
NtGdiModifyWorldTransform( pdev->dev.hdc, &xf, MWT_SET );
exclude_rotation_translation = TRUE;
}
}
if (!get_pen_device_rect( dc, pdev, &rect, left, top, right, bottom )) return TRUE;
pt[0].x = pt[0].y = 0;
......@@ -1555,23 +1572,6 @@ BOOL CDECL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
return FALSE;
}
if (pdev->brush.style != BS_NULL &&
!(interior = NtGdiCreateRoundRectRgn( rect.left, rect.top, rect.right + 1, rect.bottom + 1,
ellipse_width, ellipse_height )))
{
free( points );
if (outline) NtGdiDeleteObjectApp( outline );
return FALSE;
}
/* if not using a region, paint the interior first so the outline can overlap it */
if (interior && !outline)
{
ret = brush_region( pdev, interior );
NtGdiDeleteObjectApp( interior );
interior = 0;
}
count = ellipse_first_quadrant( ellipse_width, ellipse_height, points );
if (dc->attr->arc_direction == AD_CLOCKWISE)
......@@ -1615,13 +1615,37 @@ BOOL CDECL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
}
count = end + 1;
if (exclude_rotation_translation == TRUE)
{
NtGdiModifyWorldTransform( pdev->dev.hdc, &rotation_and_translation, MWT_SET );
/* apply rotation and translation to calculated points */
NtGdiTransformPoints( dev->hdc, points, points, count, NtGdiLPtoDP );
/* restore origin matrix */
NtGdiModifyWorldTransform( pdev->dev.hdc, &old, MWT_SET );
}
if (pdev->brush.style != BS_NULL &&
!(interior = ULongToHandle(NtGdiPolyPolyDraw( ULongToHandle(ALTERNATE), points, (const UINT *)&count, 1, NtGdiPolyPolygonRgn ))))
{
free( points );
if (outline) NtGdiDeleteObjectApp( outline );
return FALSE;
}
/* if not using a region, paint the interior first so the outline can overlap it */
if (interior && !outline)
{
ret = brush_region( pdev, interior );
NtGdiDeleteObjectApp( interior );
interior = 0;
}
reset_dash_origin( pdev );
pdev->pen_lines( pdev, count, points, TRUE, outline );
add_pen_lines_bounds( pdev, count, points, outline );
if (interior)
{
NtGdiCombineRgn( interior, interior, outline, RGN_DIFF );
ret = brush_region( pdev, interior );
NtGdiDeleteObjectApp( interior );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment