Module: wine Branch: master Commit: b88f06fd3425e04ed6148ba88d0a9dc40b654fcc URL: https://source.winehq.org/git/wine.git/?a=commit;h=b88f06fd3425e04ed6148ba88...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Fri Mar 11 14:33:07 2022 +0800
d2d1: Shrink stroke width for d2d_transformed_geometry_StrokeContainsPoint().
So that stroke width won't be transformed. Fix PowerPoint 2016 text in TextBoxes can not be selected properly.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d2d1/geometry.c | 4 ++++ dlls/d2d1/tests/d2d1.c | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c index 7f02a63f284..eb1bb353b4c 100644 --- a/dlls/d2d1/geometry.c +++ b/dlls/d2d1/geometry.c @@ -5036,9 +5036,13 @@ static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_StrokeContainsPoint(ID iface, debug_d2d_point_2f(&point), stroke_width, stroke_style, transform, tolerance, contains);
g = geometry->transform; + stroke_width /= g.m11; if (transform) d2d_matrix_multiply(&g, transform);
+ if (tolerance <= 0.0f) + tolerance = D2D1_DEFAULT_FLATTENING_TOLERANCE; + return ID2D1Geometry_StrokeContainsPoint(geometry->u.transformed.src_geometry, point, stroke_width, stroke_style, &g, tolerance, contains); } diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 731ef6e0807..90445ba84fc 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -10372,7 +10372,6 @@ static void test_stroke_contains_point(BOOL d3d11) float stroke_width; BOOL matrix; BOOL contains; - BOOL todo; } rectangle_tests[] = { @@ -10535,19 +10534,19 @@ static void test_stroke_contains_point(BOOL d3d11) { /* 0. Stroked area hittesting. Edge. Tolerance is 0.0f */ {{{{0.0f}}}, {0.74f, 2.5f}, 0.0f, 1.0f, FALSE, TRUE}, - {{{{0.0f}}}, {0.75f, 2.5f}, 0.0f, 1.0f, FALSE, FALSE, TRUE}, + {{{{0.0f}}}, {0.75f, 2.5f}, 0.0f, 1.0f, FALSE, FALSE},
/* 2. Stroked area hittesting. Edge. Tolerance is negative */ {{{{0.0f}}}, {0.74f, 2.5f}, -1.0f, 1.0f, FALSE, TRUE}, - {{{{0.0f}}}, {0.75f, 2.5f}, -1.0f, 1.0f, FALSE, FALSE, TRUE}, + {{{{0.0f}}}, {0.75f, 2.5f}, -1.0f, 1.0f, FALSE, FALSE},
/* 4. Stroked area hittesting. Edge. Tolerance is close to zero */ {{{{0.0f}}}, {0.501f, 2.5f}, 0.001f, 1.0f, FALSE, TRUE}, - {{{{0.0f}}}, {0.502f, 2.5f}, 0.001f, 1.0f, FALSE, FALSE, TRUE}, + {{{{0.0f}}}, {0.502f, 2.5f}, 0.001f, 1.0f, FALSE, FALSE},
/* 6. Stroked area hittesting. Edge. Tolerance is D2D1_DEFAULT_FLATTENING_TOLERANCE */ {{{{0.0f}}}, {0.74f, 2.5f}, 0.25f, 1.0f, FALSE, TRUE}, - {{{{0.0f}}}, {0.75f, 2.5f}, 0.25f, 1.0f, FALSE, FALSE, TRUE}, + {{{{0.0f}}}, {0.75f, 2.5f}, 0.25f, 1.0f, FALSE, FALSE}, };
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory); @@ -10657,7 +10656,6 @@ static void test_stroke_contains_point(BOOL d3d11) test->stroke_width, NULL, test->matrix ? &test->transform : NULL, test->tolerance, &contains); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine_if(test->todo) ok(contains == test->contains, "Got unexpected result %#x.\n", contains);
winetest_pop_context();