Jeff Smith : gdiplus: Implement GdipResetPageTransform.
Module: wine Branch: master Commit: 142dc48aaea0539c0c4bda82c72eb907c729ac4a URL: https://gitlab.winehq.org/wine/wine/-/commit/142dc48aaea0539c0c4bda82c72eb90... Author: Jeff Smith <whydoubt(a)gmail.com> Date: Thu Oct 26 00:15:07 2023 -0500 gdiplus: Implement GdipResetPageTransform. --- dlls/gdiplus/graphics.c | 23 ++++++++++++++++++----- dlls/gdiplus/tests/graphics.c | 4 ---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 58b2de213a6..32c45458c8f 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -7536,14 +7536,27 @@ cleanup: GpStatus WINGDIPAPI GdipResetPageTransform(GpGraphics *graphics) { - static int calls; + GpStatus stat; - TRACE("(%p) stub\n", graphics); + TRACE("(%p)\n", graphics); - if(!(calls++)) - FIXME("not implemented\n"); + if(!graphics) + return InvalidParameter; - return NotImplemented; + if(graphics->busy) + return ObjectBusy; + + if (is_metafile_graphics(graphics)) + { + stat = METAFILE_SetPageTransform((GpMetafile*)graphics->image, UnitDisplay, 1.0); + if (stat != Ok) + return stat; + } + + graphics->scale = 1.0; + graphics->unit = UnitDisplay; + + return Ok; } GpStatus WINGDIPAPI GdipGraphicsSetAbort(GpGraphics *graphics, GdiplusAbort *pabort) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 40b624df1ba..784a88d9a70 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -1829,7 +1829,6 @@ static void test_Get_Release_DC(void) status = GdipResetClip(graphics); expect(ObjectBusy, status); status = GdipResetPageTransform(graphics); - todo_wine expect(ObjectBusy, status); status = GdipResetWorldTransform(graphics); expect(ObjectBusy, status); @@ -4139,15 +4138,12 @@ static void test_set_page_transform(void) expect(Ok, status); expectf_(2.0, scale, 0); status = GdipResetPageTransform(graphics); - todo_wine expect(Ok, status); status = GdipGetPageUnit(graphics, &unit); expect(Ok, status); - todo_wine expect(UnitDisplay, unit); status = GdipGetPageScale(graphics, &scale); expect(Ok, status); - todo_wine expectf_(1.0, scale, 0); GdipDeleteGraphics(graphics);
participants (1)
-
Alexandre Julliard