update MouseEntered to MouseInsideWindow

This commit is contained in:
Stephen Michaelis 2019-01-21 17:13:51 -05:00
parent e7a625f5d2
commit 8d20deea05
3 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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