From cefa86ce134399ee00d979a876954a3f23618407 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 30 Jun 2017 10:54:13 +0900 Subject: [PATCH] ui: Fullscreen scale can be recalculated during fullscreen mode --- internal/ui/ui_glfw.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 1719df82d..29d918d73 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -362,8 +362,11 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre u.scale = origScale return false } - u.width = width - u.height = height + if u.width != width || u.height != height { + u.width = width + u.height = height + u.fullscreenScale = 0 + } // To make sure the current existing framebuffers are rendered, // swap buffers here before SetSize is called. @@ -386,7 +389,6 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre window.SetMonitor(nil, x, y, 16, 16, v.RefreshRate) u.origPosX = -1 u.origPosY = -1 - u.fullscreenScale = 0 } ch := make(chan struct{}) window.SetFramebufferSizeCallback(func(_ *glfw.Window, width, height int) {