new set-rect-bounds word for when you're setting loc and dim at the same time
parent
abe0f4bdf4
commit
d26ae3d141
|
@ -51,3 +51,8 @@ M: rect contains-point?
|
||||||
|
|
||||||
: rect-min ( rect dim -- rect' )
|
: rect-min ( rect dim -- rect' )
|
||||||
[ rect-bounds ] dip vmin <rect> ;
|
[ rect-bounds ] dip vmin <rect> ;
|
||||||
|
|
||||||
|
: set-rect-bounds ( rect1 rect -- )
|
||||||
|
[ [ loc>> ] dip (>>loc) ]
|
||||||
|
[ [ dim>> ] dip (>>dim) ]
|
||||||
|
2bi ; inline
|
|
@ -48,9 +48,7 @@ M: border baseline
|
||||||
dup border-dim [ border-loc ] keep <rect> ;
|
dup border-dim [ border-loc ] keep <rect> ;
|
||||||
|
|
||||||
M: border layout*
|
M: border layout*
|
||||||
[ gadget-child ] [ border-child-rect ] bi
|
[ border-child-rect ] [ gadget-child ] bi set-rect-bounds ;
|
||||||
[ loc>> >>loc ] [ dim>> >>dim ] bi
|
|
||||||
drop ;
|
|
||||||
|
|
||||||
M: border focusable-child*
|
M: border focusable-child*
|
||||||
gadget-child ;
|
gadget-child ;
|
||||||
|
|
|
@ -26,12 +26,12 @@ TUPLE: glass < gadget visible-rect owner ;
|
||||||
[ visible-rect>> ] [ owner>> ] bi screen-loc offset-rect ;
|
[ visible-rect>> ] [ owner>> ] bi screen-loc offset-rect ;
|
||||||
|
|
||||||
M: glass layout*
|
M: glass layout*
|
||||||
{
|
[
|
||||||
[ gadget-child ]
|
|
||||||
[ visible-rect ]
|
[ visible-rect ]
|
||||||
[ gadget-child pref-dim ]
|
[ gadget-child pref-dim ]
|
||||||
[ find-world dim>> ]
|
[ find-world dim>> ]
|
||||||
} cleave popup-loc >>loc prefer ;
|
tri popup-rect
|
||||||
|
] [ gadget-child ] bi set-rect-bounds ;
|
||||||
|
|
||||||
M: glass ungraft* gadget-child hide-glass-hook ;
|
M: glass ungraft* gadget-child hide-glass-hook ;
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ M: grid pref-dim* <grid-layout> grid-pref-dim ;
|
||||||
|
|
||||||
: grid-layout ( children grid-layout -- )
|
: grid-layout ( children grid-layout -- )
|
||||||
[ cell-locs ] [ cell-dims ] bi
|
[ cell-locs ] [ cell-dims ] bi
|
||||||
[ [ [ >>loc ] [ >>dim ] bi* drop ] 3each ] 3each ;
|
[ [ <rect> swap set-rect-bounds ] 3each ] 3each ;
|
||||||
|
|
||||||
M: grid layout* [ grid>> ] [ <grid-layout> ] bi grid-layout ;
|
M: grid layout* [ grid>> ] [ <grid-layout> ] bi grid-layout ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue