internal/uidriver/glfw: Refactoring: Rename functions

This commit is contained in:
Hajime Hoshi 2021-10-10 15:50:12 +09:00
parent 4580f9fa16
commit 4604a00e39
2 changed files with 6 additions and 6 deletions

View File

@ -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() {

View File

@ -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
})
}