From 9bf2675fa31efb01f1ad9534d84454832bdbb49e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 26 Jan 2009 16:30:17 -0600 Subject: [PATCH] Remove two rot usages from UI --- basis/ui/backend/x11/x11.factor | 22 ++++++++++------------ basis/ui/render/render.factor | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/basis/ui/backend/x11/x11.factor b/basis/ui/backend/x11/x11.factor index 245f06a316..5bcaa5bdd0 100755 --- a/basis/ui/backend/x11/x11.factor +++ b/basis/ui/backend/x11/x11.factor @@ -177,27 +177,25 @@ M: world selection-request-event } cond ; M: x11-ui-backend (close-window) ( handle -- ) - dup xic>> XDestroyIC - dup glx>> destroy-glx - window>> dup unregister-window - destroy-window ; + [ xic>> XDestroyIC ] + [ glx>> destroy-glx ] + [ window>> [ unregister-window ] [ destroy-window ] bi ] + tri ; M: world client-event swap close-box? [ ungraft ] [ drop ] if ; : gadget-window ( world -- ) - dup window-loc>> over rect-dim glx-window - over "Factor" create-xic rot - 2dup window>> register-window - >>handle drop ; + [ [ window-loc>> ] [ dim>> ] bi glx-window ] + [ "Factor" create-xic ] + [ ] tri + [ window>> register-window ] [ >>handle drop ] 2bi ; : wait-event ( -- event ) QueuedAfterFlush events-queued 0 > [ next-event dup - None XFilterEvent zero? [ drop wait-event ] unless - ] [ - ui-wait wait-event - ] if ; + None XFilterEvent 0 = [ drop wait-event ] unless + ] [ ui-wait wait-event ] if ; M: x11-ui-backend do-events wait-event dup XAnyEvent-window window dup diff --git a/basis/ui/render/render.factor b/basis/ui/render/render.factor index 3ad4c56e73..57d0d44272 100755 --- a/basis/ui/render/render.factor +++ b/basis/ui/render/render.factor @@ -137,7 +137,7 @@ TUPLE: gradient < caching-pen colors last-vertices last-colors ; :: gradient-vertices ( direction dim colors -- seq ) direction dim v* dim over v- swap colors length dup 1- v/n [ v*n ] with map - [ dup rot v+ 2array ] with map + swap [ over v+ 2array ] curry map concat concat >float-array ; : gradient-colors ( colors -- seq )