Mikolaj Zalewski : oleaut32: olepicture: When drawing metafiles set the coordinates system so that it is drawn in the correct place .

Alexandre Julliard julliard at winehq.org
Thu Oct 4 06:21:14 CDT 2007


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

Author: Mikolaj Zalewski <mikolajz at google.com>
Date:   Wed Oct  3 17:26:56 2007 -0700

oleaut32: olepicture: When drawing metafiles set the coordinates system so that it is drawn in the correct place.

---

 dlls/oleaut32/olepicture.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 6608fa2..30ecd1a 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -694,8 +694,23 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
     break;
 
   case PICTYPE_METAFILE:
-    PlayMetaFile(hdc, This->desc.u.wmf.hmeta);
+  {
+    POINT prevOrg;
+    SIZE prevExt;
+    int oldmode;
+
+    oldmode = SetMapMode(hdc, MM_ANISOTROPIC);
+    SetViewportOrgEx(hdc, x, y, &prevOrg);
+    SetViewportExtEx(hdc, cx, cy, &prevExt);
+
+    if (!PlayMetaFile(hdc, This->desc.u.wmf.hmeta))
+        ERR("PlayMetaFile failed!\n");
+
+    SetViewportExtEx(hdc, prevExt.cx, prevExt.cy, NULL);
+    SetViewportOrgEx(hdc, prevOrg.x, prevOrg.y, NULL);
+    SetMapMode(hdc, oldmode);
     break;
+  }
 
   case PICTYPE_ENHMETAFILE:
   {




More information about the wine-cvs mailing list