mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
ui: Bug fix: ScreenSizeInFullscreen returned wrong scaled values
Fixes #708
This commit is contained in:
parent
e971f6d41c
commit
b4a4b87b56
@ -233,16 +233,20 @@ func (u *userInterface) runOnMainThread(f func() error) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ScreenSizeInFullscreen() (int, int) {
|
func ScreenSizeInFullscreen() (int, int) {
|
||||||
|
u := currentUI
|
||||||
var v *glfw.VidMode
|
var v *glfw.VidMode
|
||||||
if currentUI.isRunning() {
|
s := 0.0
|
||||||
_ = currentUI.runOnMainThread(func() error {
|
if u.isRunning() {
|
||||||
v = currentUI.currentMonitor().GetVideoMode()
|
_ = u.runOnMainThread(func() error {
|
||||||
|
v = u.currentMonitor().GetVideoMode()
|
||||||
|
s = glfwScale()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
v = currentUI.currentMonitor().GetVideoMode()
|
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 {
|
func SetScreenSize(width, height int) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user