ui: Remove AdjustedCursorPosition

This commit is contained in:
Hajime Hoshi 2019-03-31 02:06:04 +09:00
parent dec6be1a11
commit 0536efd95f
4 changed files with 1 additions and 13 deletions

View File

@ -50,7 +50,7 @@ func IsKeyPressed(key Key) bool {
//
// CursorPosition is concurrent-safe.
func CursorPosition() (x, y int) {
return ui.AdjustedCursorPosition()
return ui.AdjustPosition(input.Get().CursorPosition())
}
// Wheel returns the x and y offset of the mouse wheel or touchpad scroll.

View File

@ -451,10 +451,6 @@ func ScreenPadding() (x0, y0, x1, y1 float64) {
return ox, oy, (mx - sx) - ox, (my - sy) - oy
}
func AdjustedCursorPosition() (x, y int) {
return AdjustPosition(input.Get().CursorPosition())
}
func AdjustPosition(x, y int) (int, int) {
u := currentUI
if !u.isRunning() {

View File

@ -114,10 +114,6 @@ func AdjustPosition(x, y int) (int, int) {
return int(float64(x) / scale), int(float64(y) / scale)
}
func AdjustedCursorPosition() (x, y int) {
return AdjustPosition(input.Get().CursorPosition())
}
func IsCursorVisible() bool {
// The initial value is an empty string, so don't compare with "auto" here.
return canvas.Get("style").Get("cursor").String() != "none"

View File

@ -351,10 +351,6 @@ func (u *userInterface) screenPaddingImpl() (x0, y0, x1, y1 float64) {
return ox, oy, ox, oy
}
func AdjustedCursorPosition() (x, y int) {
return AdjustPosition(input.Get().CursorPosition())
}
func AdjustPosition(x, y int) (int, int) {
return currentUI.adjustPosition(x, y)
}