ui: MonitorSize should return the 'current' monitor size instead of the primary monitor size

This commit is contained in:
Hajime Hoshi 2018-10-08 01:15:57 +09:00
parent f3b7148564
commit 4a5548a4a0
2 changed files with 1 additions and 3 deletions

View File

@ -240,7 +240,7 @@ func MonitorSize() (int, int) {
return nil
})
} else {
v = glfw.GetPrimaryMonitor().GetVideoMode()
v = currentMonitor().GetVideoMode()
}
return v.Width, v.Height
}

2
run.go
View File

@ -317,8 +317,6 @@ func RunWithoutMainLoop(f func(*Image) error, width, height int, scale float64,
// MonitorSize returns the monitor size in device-independent pixels.
// The adopted monitor is the 'current' monitor that includes the biggest area of the window.
// However, if the window doesn't exist, MonitorSize returns the 'primary' monitor,
// where the taskbar exists on Windows for example.
//
// On browsers, MonitorSize returns the 'window' size, not 'screen' size since an Ebiten game
// should not know the outside of the window object.