aboutsummaryrefslogtreecommitdiffstats
path: root/core.lua
diff options
context:
space:
mode:
authorMatthias Richter <vrld@vrld.org>2012-03-14 16:19:46 +0100
committerMatthias Richter <vrld@vrld.org>2012-03-14 16:19:46 +0100
commit6de65888dc6575a00d4e16defe92bcb0ccf08423 (patch)
tree24a22f6780a1a8a38b8c7c01cba93ce372f10ab4 /core.lua
parent2e5927e963ed0652a512291d243403fa48a72cc0 (diff)
downloadQuickie-6de65888dc6575a00d4e16defe92bcb0ccf08423.tar.gz
Quickie-6de65888dc6575a00d4e16defe92bcb0ccf08423.tar.bz2
Quickie-6de65888dc6575a00d4e16defe92bcb0ccf08423.tar.xz
Quickie-6de65888dc6575a00d4e16defe92bcb0ccf08423.zip
Externalize widget hit test to style definition.
Diffstat (limited to 'core.lua')
-rw-r--r--core.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/core.lua b/core.lua
index a52f7cd..d97e83a 100644
--- a/core.lua
+++ b/core.lua
@@ -29,12 +29,8 @@ keyboard.cycle = {
next = {key = 'tab'},
}
-function mouse.inRect(x,y,w,h)
- return mouse.x >= x and mouse.x <= x+w and mouse.y >= y and mouse.y <= y+h
-end
-
-function mouse.updateState(id, x,y,w,h)
- if mouse.inRect(x,y,w,h) then
+function mouse.updateState(id, widgetHit, ...)
+ if widgetHit(mouse.x, mouse.y, ...) then
setHot(id)
if not context.active and mouse.down then
setActive(id)