From 347b8aee6f711f900060b78f1943e0978cd16716 Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Mon, 21 Mar 2011 14:47:06 +0000 Subject: [PATCH] Make sure rectangle is not inverted in Rectangle function Fixes gdi32:Rectangle apitest svn path=/trunk/; revision=51109 --- reactos/subsystems/win32/win32k/objects/fillshap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/fillshap.c b/reactos/subsystems/win32/win32k/objects/fillshap.c index ae071d2cddf..0fb1695c1b6 100644 --- a/reactos/subsystems/win32/win32k/objects/fillshap.c +++ b/reactos/subsystems/win32/win32k/objects/fillshap.c @@ -545,10 +545,11 @@ IntRectangle(PDC dc, return PATH_Rectangle ( dc, LeftRect, TopRect, RightRect, BottomRect ); } - DestRect.left = LeftRect; - DestRect.right = RightRect; - DestRect.top = TopRect; - DestRect.bottom = BottomRect; + /* Make sure rectangle is not inverted */ + DestRect.left = min(LeftRect, RightRect); + DestRect.right = max(LeftRect, RightRect); + DestRect.top = min(TopRect, BottomRect); + DestRect.bottom = max(TopRect, BottomRect); IntLPtoDP(dc, (LPPOINT)&DestRect, 2);