d2d1: SetDpi() rejects negative values too.
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
d309b843fb
commit
e2f9bc0d0b
|
@ -1439,7 +1439,7 @@ 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)
|
||||
else if (dpi_x <= 0.0f || dpi_y <= 0.0f)
|
||||
return;
|
||||
|
||||
render_target->dpi_x = dpi_x;
|
||||
|
|
|
@ -593,6 +593,16 @@ static void test_clip(void)
|
|||
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, -10.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, -10.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);
|
||||
|
|
Loading…
Reference in New Issue