From 7677d885a25120824da08c174383090611cf83db Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 7 Jan 2015 03:08:33 +0900 Subject: [PATCH] Remove MouseButtonMax --- internal/ui/input_glfw.go | 2 +- internal/ui/mousebutton.go | 1 - mousebuttons.go | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/ui/input_glfw.go b/internal/ui/input_glfw.go index 5d9d37f02..f2f7960d6 100644 --- a/internal/ui/input_glfw.go +++ b/internal/ui/input_glfw.go @@ -37,7 +37,7 @@ func (i *input) update(window *glfw.Window, scale int) { for g, e := range glfwKeyCodeToKey { i.keyPressed[e] = window.GetKey(g) == glfw.Press } - for b := MouseButtonLeft; b < MouseButtonMax; b++ { + for b := 0; b < len(i.mouseButtonPressed); b++ { i.mouseButtonPressed[b] = window.GetMouseButton(glfw.MouseButton(b)) == glfw.Press } x, y := window.GetCursorPosition() diff --git a/internal/ui/mousebutton.go b/internal/ui/mousebutton.go index 8c7256327..276a6ebe2 100644 --- a/internal/ui/mousebutton.go +++ b/internal/ui/mousebutton.go @@ -20,5 +20,4 @@ const ( MouseButtonLeft MouseButton = iota MouseButtonRight MouseButtonMiddle - MouseButtonMax ) diff --git a/mousebuttons.go b/mousebuttons.go index 9f59cc2b9..918a40a6e 100644 --- a/mousebuttons.go +++ b/mousebuttons.go @@ -26,5 +26,4 @@ const ( MouseButtonLeft = MouseButton(ui.MouseButtonLeft) MouseButtonRight = MouseButton(ui.MouseButtonRight) MouseButtonMiddle = MouseButton(ui.MouseButtonMiddle) - MouseButtonMax = MouseButton(ui.MouseButtonMax) )