[PATCH v6 4/6] gdi32: Fix bounding box calculation for EMR_STRETCHDIBITS.

Jinoh Kang jinoh.kang.kr at gmail.com
Fri Nov 5 11:37:33 CDT 2021


rclBounds should denote a closed interval for each axis.

Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>
---
 dlls/gdi32/emfdc.c          | 4 ++--
 dlls/gdi32/tests/metafile.c | 6 ------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c
index 981849a9..203350d9 100644
--- a/dlls/gdi32/emfdc.c
+++ b/dlls/gdi32/emfdc.c
@@ -1639,8 +1639,8 @@ BOOL EMFDC_StretchDIBits( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT width_dst,
 
     emr->rclBounds.left   = x_dst;
     emr->rclBounds.top    = y_dst;
-    emr->rclBounds.right  = x_dst + width_dst;
-    emr->rclBounds.bottom = y_dst + height_dst;
+    emr->rclBounds.right  = x_dst + width_dst - 1;
+    emr->rclBounds.bottom = y_dst + height_dst - 1;
 
     /* save the record we just created */
     ret = emfdc_record( dc_attr->emf, &emr->emr );
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 261e438d..0987df95 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -6376,12 +6376,6 @@ static void test_emf_StretchDIBits(void)
         {32, 4, 4, BI_BITFIELDS, 1, EMF_STRETCHDIBITS_32BIT_4X4_SIZED, sizeof(EMF_STRETCHDIBITS_32BIT_4X4_SIZED), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}},
     };
 
-    if (!strcmp(winetest_platform, "wine"))
-    {
-        skip("Wine sets EMRSTRETCHDIBITS::rclBounds incorrectly\n");
-        return;
-    }
-
     hdc = GetDC(0);
 
     for (test_idx = 0; test_idx < ARRAY_SIZE(tests); ++test_idx)
-- 
2.33.1




More information about the wine-devel mailing list