mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
internal/uidriver/glfw: Refactoring: Rename functions
This commit is contained in:
parent
4580f9fa16
commit
4604a00e39
@ -880,11 +880,11 @@ func (u *UserInterface) init() error {
|
||||
// this. This doesn't matter on macOS.
|
||||
wx, wy := u.getInitWindowPositionInDIP()
|
||||
if runtime.GOOS == "windows" {
|
||||
u.setWindowPosition(wx, wy, u.initMonitor)
|
||||
u.setWindowPositionInDIP(wx, wy, u.initMonitor)
|
||||
setSize()
|
||||
} else {
|
||||
setSize()
|
||||
u.setWindowPosition(wx, wy, u.initMonitor)
|
||||
u.setWindowPositionInDIP(wx, wy, u.initMonitor)
|
||||
}
|
||||
|
||||
u.updateWindowSizeLimits()
|
||||
@ -1612,12 +1612,12 @@ func (u *UserInterface) setWindowResizable(resizable bool) {
|
||||
u.window.SetAttrib(glfw.Resizable, v)
|
||||
}
|
||||
|
||||
// setWindowPosition sets the window position.
|
||||
// setWindowPositionInDIP sets the window position.
|
||||
//
|
||||
// x and y are the position in device-independent pixels.
|
||||
//
|
||||
// setWindowPosition must be called from the main thread.
|
||||
func (u *UserInterface) setWindowPosition(x, y int, monitor *glfw.Monitor) {
|
||||
// setWindowPositionInDIP must be called from the main thread.
|
||||
func (u *UserInterface) setWindowPositionInDIP(x, y int, monitor *glfw.Monitor) {
|
||||
if u.setSizeCallbackEnabled {
|
||||
u.setSizeCallbackEnabled = false
|
||||
defer func() {
|
||||
|
@ -199,7 +199,7 @@ func (w *window) SetPosition(x, y int) {
|
||||
return
|
||||
}
|
||||
_ = w.ui.t.Call(func() error {
|
||||
w.ui.setWindowPosition(x, y, w.ui.currentMonitor())
|
||||
w.ui.setWindowPositionInDIP(x, y, w.ui.currentMonitor())
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user