Jinoh Kang : gdi32: Fix bounding box calculation for EMR_STRETCHDIBITS.
Alexandre Julliard
julliard at winehq.org
Mon Nov 8 15:45:05 CST 2021
Module: wine
Branch: master
Commit: 03e9b882a29c971e18f2f7024d0e4ce316c4e80c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=03e9b882a29c971e18f2f7024d0e4ce316c4e80c
Author: Jinoh Kang <jinoh.kang.kr at gmail.com>
Date: Sat Nov 6 01:37:33 2021 +0900
gdi32: Fix bounding box calculation for EMR_STRETCHDIBITS.
rclBounds should denote a closed interval for each axis.
Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 981849a9e86..203350d937d 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 261e438d670..0987df95f2d 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)
More information about the wine-cvs
mailing list