mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 11:12:44 +01:00
internal/ui: change the initial window position adjustment
The window position should be posible if possible.
This commit is contained in:
parent
a23efac01c
commit
b5d0dc3686
@ -789,18 +789,18 @@ func (u *userInterfaceImpl) createWindow() error {
|
|||||||
mw := int(u.dipFromGLFWMonitorPixel(float64(monitor.videoMode.Width), monitor))
|
mw := int(u.dipFromGLFWMonitorPixel(float64(monitor.videoMode.Width), monitor))
|
||||||
mh := int(u.dipFromGLFWMonitorPixel(float64(monitor.videoMode.Height), monitor))
|
mh := int(u.dipFromGLFWMonitorPixel(float64(monitor.videoMode.Height), monitor))
|
||||||
// Force to put the window in the initial monitor (#1575).
|
// Force to put the window in the initial monitor (#1575).
|
||||||
if wx < 0 {
|
|
||||||
wx = 0
|
|
||||||
}
|
|
||||||
if wy < 0 {
|
|
||||||
wy = 0
|
|
||||||
}
|
|
||||||
if max := mw - ww; wx >= max {
|
if max := mw - ww; wx >= max {
|
||||||
wx = max
|
wx = max
|
||||||
}
|
}
|
||||||
if max := mh - wh; wy >= max {
|
if max := mh - wh; wy >= max {
|
||||||
wy = max
|
wy = max
|
||||||
}
|
}
|
||||||
|
if wx < 0 {
|
||||||
|
wx = 0
|
||||||
|
}
|
||||||
|
if wy < 0 {
|
||||||
|
wy = 0
|
||||||
|
}
|
||||||
u.setWindowPositionInDIP(wx, wy, monitor)
|
u.setWindowPositionInDIP(wx, wy, monitor)
|
||||||
|
|
||||||
// Though the size is already specified, call setWindowSizeInDIP explicitly to adjust member variables.
|
// Though the size is already specified, call setWindowSizeInDIP explicitly to adjust member variables.
|
||||||
|
Loading…
Reference in New Issue
Block a user