From 6de65888dc6575a00d4e16defe92bcb0ccf08423 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Wed, 14 Mar 2012 16:19:46 +0100 Subject: Externalize widget hit test to style definition. --- core.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'core.lua') 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) -- cgit v1.2.3-54-g00ecf