Ken Thomases : winemac: Make cgrect_from_rect() preserve origin of empty rectangles.

Alexandre Julliard julliard at winehq.org
Wed Aug 21 14:09:05 CDT 2013


Module: wine
Branch: master
Commit: 87dd13150a69a57ad524daed72d5405064db39fa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=87dd13150a69a57ad524daed72d5405064db39fa

Author: Ken Thomases <ken at codeweavers.com>
Date:   Tue Aug 20 17:00:27 2013 -0500

winemac: Make cgrect_from_rect() preserve origin of empty rectangles.

---

 dlls/winemac.drv/macdrv.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 4c74ddc..9bf1b7a 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -44,9 +44,7 @@ extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN;
 
 static inline CGRect cgrect_from_rect(RECT rect)
 {
-    if (rect.left >= rect.right || rect.top >= rect.bottom)
-        return CGRectNull;
-    return CGRectMake(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
+    return CGRectMake(rect.left, rect.top, max(0, rect.right - rect.left), max(0, rect.bottom - rect.top));
 }
 
 static inline RECT rect_from_cgrect(CGRect cgrect)




More information about the wine-cvs mailing list