summaryrefslogtreecommitdiff
path: root/area_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-10 18:52:43 -0400
committerPietro Gagliardi <[email protected]>2014-04-10 18:52:43 -0400
commita01ffafba0fac94c539eca33528af20b3e02cec5 (patch)
treef17bbcac9474798bd9e8c06708a1c579351bb9b1 /area_windows.go
parentbd907dadd8d601acc4208b38c374aa0bcdb7c43f (diff)
Fixed Area mouse events being sent when something happens outside the Area itself.
Diffstat (limited to 'area_windows.go')
-rw-r--r--area_windows.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/area_windows.go b/area_windows.go
index a0b855d..d9497bf 100644
--- a/area_windows.go
+++ b/area_windows.go
@@ -358,6 +358,9 @@ func areaMouseEvent(s *sysData, button uint, up bool, count uint, wparam _WPARAM
xpos += lparam._X()
ypos += lparam._Y()
me.Pos = image.Pt(int(xpos), int(ypos))
+ if !me.Pos.In(image.Rect(0, 0, s.areawidth, s.areaheight)) { // outside the actual Area; no event
+ return
+ }
if up {
me.Up = button
} else {