diff --git a/basis/ui/gadgets/frames/frames.factor b/basis/ui/gadgets/frames/frames.factor index c210d1b7e2..2005fefed7 100644 --- a/basis/ui/gadgets/frames/frames.factor +++ b/basis/ui/gadgets/frames/frames.factor @@ -11,16 +11,16 @@ TUPLE: frame < grid ; : ( -- grid ) 9 [ ] replicate 3 group ; -: @center 1 1 ; -: @left 0 1 ; -: @right 2 1 ; -: @top 1 0 ; -: @bottom 1 2 ; +: @center 1 1 ; inline +: @left 0 1 ; inline +: @right 2 1 ; inline +: @top 1 0 ; inline +: @bottom 1 2 ; inline -: @top-left 0 0 ; -: @top-right 2 0 ; -: @bottom-left 0 2 ; -: @bottom-right 2 2 ; +: @top-left 0 0 ; inline +: @top-right 2 0 ; inline +: @bottom-left 0 2 ; inline +: @bottom-right 2 2 ; inline : new-frame ( class -- frame ) swap new-grid ; inline @@ -28,13 +28,12 @@ TUPLE: frame < grid ; : ( -- frame ) frame new-frame ; -: (fill-center) ( vec n -- ) - over first pick third v+ [v-] 1 rot set-nth ; +: (fill-center) ( n vec -- ) + [ [ first ] [ third ] bi v+ [v-] ] keep set-second ; -: fill-center ( horiz vert dim -- ) - tuck (fill-center) (fill-center) ; +: fill-center ( dim horiz vert -- ) + [ over ] dip [ (fill-center) ] 2bi@ ; M: frame layout* dup compute-grid - [ rot rect-dim fill-center ] 3keep - grid-layout ; + [ [ rect-dim ] 2dip fill-center ] [ grid-layout ] 3bi ;