ui: Bug fix: ScreenSizeInFullscreen returned wrong scaled values

Fixes #708
This commit is contained in:
Hajime Hoshi 2018-10-10 03:10:16 +09:00
parent e971f6d41c
commit b4a4b87b56

View File

@ -233,16 +233,20 @@ func (u *userInterface) runOnMainThread(f func() error) error {
}
func ScreenSizeInFullscreen() (int, int) {
u := currentUI
var v *glfw.VidMode
if currentUI.isRunning() {
_ = currentUI.runOnMainThread(func() error {
v = currentUI.currentMonitor().GetVideoMode()
s := 0.0
if u.isRunning() {
_ = u.runOnMainThread(func() error {
v = u.currentMonitor().GetVideoMode()
s = glfwScale()
return nil
})
} else {
v = currentUI.currentMonitor().GetVideoMode()
s = glfwScale()
}
return v.Width, v.Height
return int(float64(v.Width) / s), int(float64(v.Height) / s)
}
func SetScreenSize(width, height int) bool {