mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
ui: Adjust cursor position on fullscreen (#267)
This commit is contained in:
parent
e7370d8a54
commit
5b6fa2d384
@ -240,11 +240,10 @@ func (u *userInterface) glfwSize() (int, int) {
|
||||
return int(float64(u.width) * u.scale * u.glfwScale), int(float64(u.height) * u.scale * u.glfwScale)
|
||||
}
|
||||
|
||||
func (u *userInterface) actualScreenScale() float64 {
|
||||
if u.deviceScale == 0 {
|
||||
u.deviceScale = deviceScale()
|
||||
func (u *userInterface) getScale() float64 {
|
||||
if !u.fullscreen {
|
||||
return u.scale
|
||||
}
|
||||
if u.fullscreen {
|
||||
if u.fullscreenScale == 0 {
|
||||
m := glfw.GetPrimaryMonitor()
|
||||
v := m.GetVideoMode()
|
||||
@ -256,9 +255,14 @@ func (u *userInterface) actualScreenScale() float64 {
|
||||
}
|
||||
u.fullscreenScale = s
|
||||
}
|
||||
return u.fullscreenScale * u.deviceScale
|
||||
return u.fullscreenScale
|
||||
}
|
||||
|
||||
func (u *userInterface) actualScreenScale() float64 {
|
||||
if u.deviceScale == 0 {
|
||||
u.deviceScale = deviceScale()
|
||||
}
|
||||
return u.scale * u.deviceScale
|
||||
return u.getScale() * u.deviceScale
|
||||
}
|
||||
|
||||
func (u *userInterface) pollEvents() {
|
||||
@ -266,7 +270,7 @@ func (u *userInterface) pollEvents() {
|
||||
if u.glfwScale == 0 {
|
||||
u.glfwScale = glfwScale()
|
||||
}
|
||||
currentInput.update(u.window, u.scale*u.glfwScale)
|
||||
currentInput.update(u.window, u.getScale()*u.glfwScale)
|
||||
}
|
||||
|
||||
func (u *userInterface) update(g GraphicsContext) error {
|
||||
|
Loading…
Reference in New Issue
Block a user