d2d1: Don't update target dpi if only one SetDpi() argument is zero.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f26e13f38f
commit
c05dd9e11f
|
@ -1436,6 +1436,8 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_SetDpi(ID2D1RenderTarget *if
|
|||
dpi_x = 96.0f;
|
||||
dpi_y = 96.0f;
|
||||
}
|
||||
else if (dpi_x == 0.0f || dpi_y == 0.0f)
|
||||
return;
|
||||
|
||||
render_target->dpi_x = dpi_x;
|
||||
render_target->dpi_y = dpi_y;
|
||||
|
|
|
@ -587,6 +587,19 @@ static void test_clip(void)
|
|||
ok(dpi_x == 96.0f, "Got unexpected dpi_x %.8e.\n", dpi_x);
|
||||
ok(dpi_y == 96.0f, "Got unexpected dpi_y %.8e.\n", dpi_y);
|
||||
|
||||
ID2D1RenderTarget_SetDpi(rt, 192.0f, 192.0f);
|
||||
ID2D1RenderTarget_SetDpi(rt, 0.0f, 96.0f);
|
||||
ID2D1RenderTarget_GetDpi(rt, &dpi_x, &dpi_y);
|
||||
ok(dpi_x == 192.0f, "Got unexpected dpi_x %.8e.\n", dpi_x);
|
||||
ok(dpi_y == 192.0f, "Got unexpected dpi_y %.8e.\n", dpi_y);
|
||||
|
||||
ID2D1RenderTarget_SetDpi(rt, 96.0f, 0.0f);
|
||||
ID2D1RenderTarget_GetDpi(rt, &dpi_x, &dpi_y);
|
||||
ok(dpi_x == 192.0f, "Got unexpected dpi_x %.8e.\n", dpi_x);
|
||||
ok(dpi_y == 192.0f, "Got unexpected dpi_y %.8e.\n", dpi_y);
|
||||
|
||||
ID2D1RenderTarget_SetDpi(rt, 96.0f, 96.0f);
|
||||
|
||||
/* Transformations apply to clip rects, the effective clip rect is the
|
||||
* (axis-aligned) bounding box of the transformed clip rect. */
|
||||
set_point(&point, 320.0f, 240.0f);
|
||||
|
|
Loading…
Reference in New Issue