Fix rounding error
parent
d582c260ac
commit
2a5a5ee376
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays kernel locals math math.order math.vectors
|
USING: arrays kernel locals math math.functions math.order math.vectors
|
||||||
sequences ui.gadgets accessors combinators ;
|
sequences ui.gadgets accessors combinators ;
|
||||||
IN: ui.baseline-alignment
|
IN: ui.baseline-alignment
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ TUPLE: gadget-metrics height ascent descent cap-height ;
|
||||||
ascent [
|
ascent [
|
||||||
cap-height 2 / :> mid-line
|
cap-height 2 / :> mid-line
|
||||||
graphics-height 2 /
|
graphics-height 2 /
|
||||||
[ ascent mid-line - max mid-line + >integer ]
|
[ ascent mid-line - max mid-line + ceiling >integer ]
|
||||||
[ descent mid-line + max mid-line - >integer ] bi
|
[ descent mid-line + max mid-line - floor >integer ] bi
|
||||||
] [ f f ] if ;
|
] [ f f ] if ;
|
||||||
|
|
||||||
: (measure-metrics) ( children sizes -- graphics-height ascent descent cap-height )
|
: (measure-metrics) ( children sizes -- graphics-height ascent descent cap-height )
|
||||||
|
|
Loading…
Reference in New Issue