mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ui: Refactoring: Use the current monitor
This commit is contained in:
parent
c0884b5ab2
commit
16f6aeaa4a
@ -383,8 +383,7 @@ func ScreenPadding() (x0, y0, x1, y1 float64) {
|
|||||||
return ox, 0, ox, 0
|
return ox, 0, ox, 0
|
||||||
}
|
}
|
||||||
|
|
||||||
m := glfw.GetPrimaryMonitor()
|
v := u.window.GetMonitor().GetVideoMode()
|
||||||
v := m.GetVideoMode()
|
|
||||||
d := u.deviceScale.Get()
|
d := u.deviceScale.Get()
|
||||||
|
|
||||||
mx := float64(v.Width) * d / glfwScale()
|
mx := float64(v.Width) * d / glfwScale()
|
||||||
@ -527,8 +526,7 @@ func (u *userInterface) getScale() float64 {
|
|||||||
return u.scale
|
return u.scale
|
||||||
}
|
}
|
||||||
if u.fullscreenScale == 0 {
|
if u.fullscreenScale == 0 {
|
||||||
m := glfw.GetPrimaryMonitor()
|
v := u.window.GetMonitor().GetVideoMode()
|
||||||
v := m.GetVideoMode()
|
|
||||||
sw := float64(v.Width) / glfwScale() / float64(u.width)
|
sw := float64(v.Width) / glfwScale() / float64(u.width)
|
||||||
sh := float64(v.Height) / glfwScale() / float64(u.height)
|
sh := float64(v.Height) / glfwScale() / float64(u.height)
|
||||||
s := sw
|
s := sw
|
||||||
|
Loading…
Reference in New Issue
Block a user