libui/windows: some work on hiDPI shit

still looks derpy but atleast the rendering and touchscreen aren't broken
This commit is contained in:
StapleButter
2018-12-21 05:01:37 +01:00
parent f86fe46035
commit 63ae6bf8fb
6 changed files with 27 additions and 3 deletions

View File

@ -26,6 +26,16 @@ static HRESULT doPaint(uiArea *a, ID2D1RenderTarget *rt, RECT *clip)
rt->BeginDraw();
{
float dpi_x, dpi_y;
D2D1_MATRIX_3X2_F dm;
rt->GetDpi(&dpi_x, &dpi_y);
ZeroMemory(&dm, sizeof (D2D1_MATRIX_3X2_F));
dm._11 = 96.f/dpi_x;
dm._22 = 96.f/dpi_y;
rt->SetTransform(&dm);
}
if (a->scrolling) {
ZeroMemory(&scrollTransform, sizeof (D2D1_MATRIX_3X2_F));
scrollTransform._11 = 1;