ui.gadgets: cleaner fast-children-on

db4
Eduardo Cavazos 2008-07-12 17:57:57 -05:00
parent 33da43aa90
commit 80783019c2
1 changed files with 3 additions and 7 deletions

View File

@ -74,13 +74,9 @@ M: gadget children-on nip children>> ;
swapd [ rect-loc v- over v. 0 <=> ] binsearch nip ;
: fast-children-on ( rect axis children -- from to )
3dup
>r >r dup rect-loc swap rect-dim v+
r> r> (fast-children-on) ?1+
>r
>r >r rect-loc
r> r> (fast-children-on) 0 or
r> ;
[ >r >r rect-loc r> r> (fast-children-on) 0 or ]
[ >r >r dup rect-loc swap rect-dim v+ r> r> (fast-children-on) ?1+ ]
3bi ;
: inside? ( bounds gadget -- ? )
dup visible?>> [ intersects? ] [ 2drop f ] if ;