diff --git a/dlls/gdi32/mapping.c b/dlls/gdi32/mapping.c index d30d98b8592..381c29dd26f 100644 --- a/dlls/gdi32/mapping.c +++ b/dlls/gdi32/mapping.c @@ -366,6 +366,11 @@ BOOL WINAPI NtGdiModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode ) case MWT_RIGHTMULTIPLY: ret = CombineTransform( &dc->xformWorld2Wnd, &dc->xformWorld2Wnd, xform ); break; + case MWT_SET: + ret = dc->attr->graphics_mode == GM_ADVANCED && + xform->eM11 * xform->eM22 != xform->eM12 * xform->eM21; + if (ret) dc->xformWorld2Wnd = *xform; + break; } if (ret) DC_UpdateXforms( dc ); release_dc_ptr( dc ); diff --git a/dlls/gdi32/tests/mapping.c b/dlls/gdi32/tests/mapping.c index fece9da94dc..90c9d5a6617 100644 --- a/dlls/gdi32/tests/mapping.c +++ b/dlls/gdi32/tests/mapping.c @@ -385,6 +385,7 @@ static void test_dc_layout(void) static void test_modify_world_transform(void) { HDC hdc = GetDC(0); + XFORM xform, xform2; int ret; ret = SetGraphicsMode(hdc, GM_ADVANCED); @@ -399,6 +400,27 @@ static void test_modify_world_transform(void) ret = ModifyWorldTransform(hdc, NULL, MWT_RIGHTMULTIPLY); ok(!ret, "ret = %d\n", ret); + xform.eM11 = 2; + xform.eM12 = 0; + xform.eM21 = 0; + xform.eM22 = 1; + xform.eDx = xform.eDy = 0; + ret = ModifyWorldTransform(hdc, &xform, 4); + ok(ret, "ModifyWorldTransform failed\n"); + + memset(&xform2, 0xcc, sizeof(xform2)); + ret = GetWorldTransform(hdc, &xform2); + ok(ret, "GetWorldTransform failed\n"); + ok(!memcmp(&xform, &xform2, sizeof(xform)), "unexpected xform\n"); + + xform.eM11 = 1; + xform.eM12 = 1; + xform.eM21 = 1; + xform.eM22 = 1; + xform.eDx = xform.eDy = 0; + ret = ModifyWorldTransform(hdc, &xform, 4); + ok(!ret, "ModifyWorldTransform succeeded\n"); + ReleaseDC(0, hdc); } diff --git a/include/ntgdi.h b/include/ntgdi.h index 9aeaea5d3cb..9132d606c43 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -105,6 +105,8 @@ enum NtGdiSetMapMode = 8, }; +#define MWT_SET 4 + /* structs not compatible with native Windows */ #ifdef __WINESRC__