update MouseEntered to MouseInsideWindow
This commit is contained in:
parent
e7a625f5d2
commit
8d20deea05
|
@ -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),
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue