ui.gadgets.paragraphs: need to merge height/metrics.
Sometimes cap-height is false and we handle that differently.master
parent
086269ba34
commit
dc8e6e6799
|
@ -99,3 +99,7 @@ PRIVATE>
|
||||||
|
|
||||||
: measure-height ( children sizes -- height )
|
: measure-height ( children sizes -- height )
|
||||||
(measure-metrics) [ combine-metrics + ] [ 2drop ] if* ;
|
(measure-metrics) [ combine-metrics + ] [ 2drop ] if* ;
|
||||||
|
|
||||||
|
: measure-height-metrics ( children sizes -- height ascent descent )
|
||||||
|
(measure-metrics) [ dup ] 3dip
|
||||||
|
[ combine-metrics ] keep [ [ + nip ] 2keep ] when ;
|
||||||
|
|
|
@ -37,7 +37,7 @@ TUPLE: line words width height baseline ;
|
||||||
|
|
||||||
: <line> ( words -- line )
|
: <line> ( words -- line )
|
||||||
[ ] [ line-width ] [ [ key>> ] map dup pref-dims ] tri
|
[ ] [ line-width ] [ [ key>> ] map dup pref-dims ] tri
|
||||||
measure-metrics [ + ] 2keep drop line boa ;
|
measure-height-metrics drop line boa ;
|
||||||
|
|
||||||
: wrap-paragraph ( paragraph -- wrapped-paragraph )
|
: wrap-paragraph ( paragraph -- wrapped-paragraph )
|
||||||
[ children>> [ gadget>word ] map ] [ margin>> ] bi
|
[ children>> [ gadget>word ] map ] [ margin>> ] bi
|
||||||
|
|
Loading…
Reference in New Issue