From 94429c8fd8f2e88a950832e3aa9d3ad64d280624 Mon Sep 17 00:00:00 2001 From: Christopher Dieringer Date: Tue, 16 Feb 2021 03:41:21 -0800 Subject: [PATCH] gg: window_size: normalize dpi scaling (#8738) --- vlib/gg/gg.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/gg/gg.v b/vlib/gg/gg.v index 75f15ba03a..9c46096fe2 100644 --- a/vlib/gg/gg.v +++ b/vlib/gg/gg.v @@ -709,7 +709,8 @@ pub fn screen_size() Size { // window_size returns the `Size` of the active window pub fn window_size() Size { - return Size{sapp.width(), sapp.height()} + s := sapp.dpi_scale() + return Size{int(sapp.width() / s), int(sapp.height() / s)} } fn C.WaitMessage()