Commit b88f06fd authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f2dbb0b4
......@@ -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);
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment