Overhauled mouse events
Everything gets an image.Point instead of an x y pair, and most things now get modifiers.
This commit is contained in:
parent
eaee284aaf
commit
53f78cb0e7
@ -189,6 +189,7 @@ func (window *window) handleButtonPress (
|
|||||||
point := image.Pt(int(buttonEvent.EventX), int(buttonEvent.EventY))
|
point := image.Pt(int(buttonEvent.EventX), int(buttonEvent.EventY))
|
||||||
insideWindow := point.In(window.canvas.Bounds())
|
insideWindow := point.In(window.canvas.Bounds())
|
||||||
scrolling := buttonEvent.Detail >= 4 && buttonEvent.Detail <= 7
|
scrolling := buttonEvent.Detail >= 4 && buttonEvent.Detail <= 7
|
||||||
|
modifiers := window.modifiersFromState(buttonEvent.State)
|
||||||
|
|
||||||
if !insideWindow && window.shy && !scrolling {
|
if !insideWindow && window.shy && !scrolling {
|
||||||
window.Close()
|
window.Close()
|
||||||