From d7774d96fce7b8b11be4f1e577dd3ba9dada301c Mon Sep 17 00:00:00 2001 From: Mikolaj Zalewski Date: Wed, 3 Oct 2007 17:26:56 -0700 Subject: [PATCH] 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 513e816..aa3fa0d 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -694,8 +694,23 @@ static HRESULT WINAPI OLEPictureImpl_Ren 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: { -- 1.4.1