From 57c123a412264b99357fa3e3f936e86e36d50caf Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 9 Feb 2022 22:16:28 +0900 Subject: [PATCH] internal/ui: add comments Updates #1804 --- internal/ui/ui_glfw.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index b028d7d65..d681e1f6c 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -1304,6 +1304,9 @@ func (u *UserInterface) setWindowSizeInDIPImpl(width, height int, fullscreen boo } } + // TODO: This must be called just after the window is created. + // This relies on the initial value of lastDeviceScaleFactor is 0 so this is called, but the condition is fragile. + // Refactor this. n, d := glfw.DontCare, glfw.DontCare if !fullscreen && u.isWindowAspectRatioFixed() { n, d = u.window.GetSize()