mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ui: Bug fix: (Set)WindowPosition didn't work well with fullscreen mode
This commit is contained in:
parent
6cd0b44baa
commit
b8a099e354
@ -1026,6 +1026,9 @@ func (u *UserInterface) SetWindowPosition(x, y int) {
|
||||
return
|
||||
}
|
||||
_ = u.t.Call(func() error {
|
||||
if u.isFullscreen() {
|
||||
return nil
|
||||
}
|
||||
u.window.SetPos(x, y)
|
||||
return nil
|
||||
})
|
||||
@ -1037,6 +1040,10 @@ func (u *UserInterface) WindowPosition() (int, int) {
|
||||
}
|
||||
x, y := 0, 0
|
||||
_ = u.t.Call(func() error {
|
||||
if u.isFullscreen() {
|
||||
x, y = u.origPosX, u.origPosY
|
||||
return nil
|
||||
}
|
||||
x, y = u.window.GetPos()
|
||||
return nil
|
||||
})
|
||||
|
@ -99,6 +99,8 @@ func SetWindowIcon(iconImages []image.Image) {
|
||||
//
|
||||
// WindowPosition panics before Run is called.
|
||||
//
|
||||
// WindowPosition returns the last window position on fullscreen mode.
|
||||
//
|
||||
// WindowPosition returns (0, 0) on browsers and mobiles.
|
||||
//
|
||||
// WindowPosition is concurrent-safe.
|
||||
@ -110,6 +112,8 @@ func WindowPosition() (x, y int) {
|
||||
//
|
||||
// SetWindowPosition works before and after Run is called.
|
||||
//
|
||||
// SetWindowPosition does nothing on fullscreen mode.
|
||||
//
|
||||
// SetWindowPosition does nothing on browsers and mobiles.
|
||||
//
|
||||
// SetWindowPosition is concurrent-safe.
|
||||
|
Loading…
Reference in New Issue
Block a user