mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: bug fix: use the native unit for origWindowPosByOS
This commit is contained in:
parent
90070c09fe
commit
2008916261
@ -394,11 +394,10 @@ func (u *userInterfaceImpl) origWindowPosByOS() (int, int, bool) {
|
|||||||
if !u.isNativeFullscreen() {
|
if !u.isNativeFullscreen() {
|
||||||
return invalidPos, invalidPos, true
|
return invalidPos, invalidPos, true
|
||||||
}
|
}
|
||||||
m := u.currentMonitor()
|
|
||||||
var cx, cy C.int
|
var cx, cy C.int
|
||||||
C.windowOriginalPosition(C.uintptr_t(u.window.GetCocoaWindow()), &cx, &cy)
|
C.windowOriginalPosition(C.uintptr_t(u.window.GetCocoaWindow()), &cx, &cy)
|
||||||
x := int(u.dipFromGLFWPixel(float64(cx), m))
|
x := int(cx)
|
||||||
y := int(u.dipFromGLFWPixel(float64(flipY(int(cy))), m)) - u.windowHeightInDIP
|
y := flipY(int(cy)) - u.windowHeightInDIP
|
||||||
return x, y, true
|
return x, y, true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,9 +405,8 @@ func (u *userInterfaceImpl) setOrigWindowPosByOS(x, y int) bool {
|
|||||||
if !u.isNativeFullscreen() {
|
if !u.isNativeFullscreen() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
m := u.currentMonitor()
|
cx := C.int(x)
|
||||||
cx := C.int(u.dipToGLFWPixel(float64(x), m))
|
cy := C.int(flipY(y + u.windowHeightInDIP))
|
||||||
cy := C.int(flipY(int(u.dipToGLFWPixel(float64(y+u.windowHeightInDIP), m))))
|
|
||||||
C.setWindowOriginalPosition(C.uintptr_t(u.window.GetCocoaWindow()), cx, cy)
|
C.setWindowOriginalPosition(C.uintptr_t(u.window.GetCocoaWindow()), cx, cy)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user