diff --git a/extra/trails/trails.factor b/extra/trails/trails.factor index 805c731e47..31d4874aac 100644 --- a/extra/trails/trails.factor +++ b/extra/trails/trails.factor @@ -11,11 +11,10 @@ IN: trails ! Return the mouse location relative to the current gadget hand-loc get hand-gadget get screen-loc v- ; -: point-list ( n -- seq ) { 0 0 } ; - : percent->radius ( percent -- radius ) neg 1 + 25 * 5 max ; -: dot ( pos percent -- ) percent->radius draw-circle ; +: dot ( pos percent -- ) + '[ _ percent->radius draw-circle ] when* ; TUPLE: trails-gadget < gadget points timer ; @@ -28,7 +27,7 @@ M: trails-gadget ungraft* :: iterate-system ( GADGET -- ) ! Add a valid point if the mouse is in the gadget ! Otherwise, add an "invisible" point - hand-gadget get GADGET = [ mouse ] [ { -10 -10 } ] if + hand-gadget get GADGET = [ mouse ] [ f ] if GADGET points>> circular-push ; M: trails-gadget pref-dim* drop { 500 500 } ; @@ -44,7 +43,7 @@ M:: trails-gadget draw-gadget* ( GADGET -- ) : ( -- trails-gadget ) trails-gadget new - 300 point-list >>points + 300 f >>points t >>clipped? dup '[ _ dup iterate-system relayout-1 ] f 10 milliseconds >>timer ;