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

This commit is contained in:
Mikolaj Zalewski 2007-10-03 17:26:56 -07:00 committed by Alexandre Julliard
parent 8e7e2c25aa
commit b2648b8285
1 changed files with 16 additions and 1 deletions

View File

@ -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:
{