diff --git a/geometry.go b/geometry.go index 0543842..72d148e 100644 --- a/geometry.go +++ b/geometry.go @@ -84,7 +84,7 @@ func (u Vec) Sub(v Vec) Vec { } } -// Floor returns converts x and y to their integer equivalents. +// Floor converts x and y to their integer equivalents. func (u Vec) Floor() Vec { return Vec{ math.Floor(u.X), diff --git a/pixelgl/input.go b/pixelgl/input.go index 01eeb62..5cf2d9a 100644 --- a/pixelgl/input.go +++ b/pixelgl/input.go @@ -55,8 +55,8 @@ func (w *Window) SetMousePosition(v pixel.Vec) { } // MouseEntered returns true if the mouse position is within the Window's Bounds. -func (w *Window) MouseEntered() bool { - return w.cursorEntered +func (w *Window) MouseInsideWindow() bool { + return w.cursorInsideWindow } // MouseScroll returns the mouse scroll amount (in both axes) since the last call to Window.Update. @@ -381,7 +381,7 @@ func (w *Window) initInput() { }) w.window.SetCursorEnterCallback(func(_ *glfw.Window, entered bool) { - w.cursorEntered = entered + w.cursorInsideWindow = entered }) w.window.SetCursorPosCallback(func(_ *glfw.Window, x, y float64) { diff --git a/pixelgl/window.go b/pixelgl/window.go index 7fb4dda..8e65277 100644 --- a/pixelgl/window.go +++ b/pixelgl/window.go @@ -55,11 +55,11 @@ type WindowConfig struct { type Window struct { window *glfw.Window - bounds pixel.Rect - canvas *Canvas - vsync bool - cursorVisible bool - cursorEntered bool + bounds pixel.Rect + canvas *Canvas + vsync bool + cursorVisible bool + cursorInsideWindow bool // need to save these to correctly restore a fullscreen window restore struct {