[1/14] gdiplus: added support for more page units

Evan Stade estade at gmail.com
Tue Jul 24 19:18:34 CDT 2007


Hi,

Changelog:
*added support for more page units
*disallow UnitWorld unit type

 dlls/gdiplus/graphics.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 8a53c03..df481cd 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -93,6 +93,17 @@ static void transform_and_round_points(G
         case UnitInch:
             unitscale = GetDeviceCaps(graphics->hdc, LOGPIXELSX);
             break;
+        case UnitPoint:
+            unitscale = ((REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX)) / 72.0;
+            break;
+        case UnitDocument:
+            unitscale = ((REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX)) / 300.0;
+            break;
+        case UnitMillimeter:
+            unitscale = ((REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX)) / 25.4;
+            break;
+        case UnitPixel:
+        case UnitDisplay:
         default:
             unitscale = 1.0;
             break;
@@ -1151,7 +1162,7 @@ GpStatus WINGDIPAPI GdipSetInterpolation
 
 GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit)
 {
-    if(!graphics)
+    if(!graphics || (unit == UnitWorld))
         return InvalidParameter;
 
     graphics->unit = unit;
-- 
1.4.1


More information about the wine-patches mailing list