Get rid of a spin usage

db4
Slava Pestov 2009-01-15 15:48:44 -06:00
parent 24f9dada5e
commit 0bcc9b4123
1 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
! Copyright (C) 2006, 2008 Slava Pestov. ! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel accessors math namespaces opengl opengl.gl USING: kernel accessors math namespaces opengl opengl.gl
sequences math.vectors ui.gadgets ui.gadgets.grids ui.render sequences math.vectors ui.gadgets ui.gadgets.grids ui.render
@ -14,9 +14,9 @@ SYMBOL: grid-dim
: half-gap ( -- gap ) grid get gap>> [ 2/ ] map ; inline : half-gap ( -- gap ) grid get gap>> [ 2/ ] map ; inline
: grid-line-from/to ( orientation point -- from to ) : grid-line-from/to ( orientation point -- from to )
half-gap v- half-gap v- swap
[ half-gap spin set-axis ] 2keep [ [ half-gap ] 2dip set-axis ]
grid-dim get spin set-axis ; [ [ grid-dim get ] 2dip set-axis ] 2bi ;
: draw-grid-lines ( gaps orientation -- ) : draw-grid-lines ( gaps orientation -- )
[ grid get swap grid-positions grid get rect-dim suffix ] dip [ grid get swap grid-positions grid get rect-dim suffix ] dip
@ -25,9 +25,9 @@ SYMBOL: grid-dim
M: grid-lines draw-boundary M: grid-lines draw-boundary
color>> gl-color [ color>> gl-color [
dup grid set [ grid set ]
dup rect-dim half-gap v- grid-dim set [ rect-dim half-gap v- grid-dim set ]
compute-grid [ compute-grid ] tri
[ { 1 0 } draw-grid-lines ] [ { 1 0 } draw-grid-lines ]
[ { 0 1 } draw-grid-lines ] [ { 0 1 } draw-grid-lines ]
bi* bi*