From 68fbf5972007e01535dcd8ff6a25922a312e5b23 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 30 Jun 2017 11:07:19 +0900 Subject: [PATCH] ui: Refactoring --- internal/ui/ui_glfw.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 29d918d73..7585d48fe 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -289,15 +289,17 @@ func (u *userInterface) update(g GraphicsContext) error { } actualScale := 0.0 + sizeChanged := false _ = u.runOnMainThread(func() error { if !u.sizeChanged { return nil } u.sizeChanged = false actualScale = u.actualScreenScale() + sizeChanged = true return nil }) - if 0 < actualScale { + if sizeChanged { g.SetSize(u.width, u.height, actualScale) }