mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
ui: Refactoring: refresh rate is ignored when no monitor is specified at SetMonitor
This commit is contained in:
parent
68fbf59720
commit
3168af1db4
@ -377,18 +377,18 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre
|
|||||||
u.fullscreen = fullscreen
|
u.fullscreen = fullscreen
|
||||||
|
|
||||||
window := u.window
|
window := u.window
|
||||||
m := glfw.GetPrimaryMonitor()
|
|
||||||
v := m.GetVideoMode()
|
|
||||||
if u.fullscreen {
|
if u.fullscreen {
|
||||||
if u.origPosX < 0 && u.origPosY < 0 {
|
if u.origPosX < 0 && u.origPosY < 0 {
|
||||||
u.origPosX, u.origPosY = window.GetPos()
|
u.origPosX, u.origPosY = window.GetPos()
|
||||||
}
|
}
|
||||||
|
m := glfw.GetPrimaryMonitor()
|
||||||
|
v := m.GetVideoMode()
|
||||||
window.SetMonitor(m, 0, 0, v.Width, v.Height, v.RefreshRate)
|
window.SetMonitor(m, 0, 0, v.Width, v.Height, v.RefreshRate)
|
||||||
} else {
|
} else {
|
||||||
if u.origPosX >= 0 && u.origPosY >= 0 {
|
if u.origPosX >= 0 && u.origPosY >= 0 {
|
||||||
x := u.origPosX
|
x := u.origPosX
|
||||||
y := u.origPosY
|
y := u.origPosY
|
||||||
window.SetMonitor(nil, x, y, 16, 16, v.RefreshRate)
|
window.SetMonitor(nil, x, y, 16, 16, 0)
|
||||||
u.origPosX = -1
|
u.origPosX = -1
|
||||||
u.origPosY = -1
|
u.origPosY = -1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user