Use swedish rounding
This commit is contained in:
parent
6a8c26b364
commit
aa992e5063
|
@ -276,6 +276,9 @@
|
||||||
[_ (sizing-ideal s)]))
|
[_ (sizing-ideal s)]))
|
||||||
sizings))))
|
sizings))))
|
||||||
|
|
||||||
|
(define (swedish-round x)
|
||||||
|
(floor (+ x 1/2)))
|
||||||
|
|
||||||
(define (compute-concrete-adjacent-layout vertical? items candidates top left width height)
|
(define (compute-concrete-adjacent-layout vertical? items candidates top left width height)
|
||||||
(define actual-sizes
|
(define actual-sizes
|
||||||
(if vertical?
|
(if vertical?
|
||||||
|
@ -285,8 +288,8 @@
|
||||||
(for/fold [(pos (if vertical? top left)) (entries-rev '())]
|
(for/fold [(pos (if vertical? top left)) (entries-rev '())]
|
||||||
[(entry candidates) (item items) (actual-size actual-sizes)]
|
[(entry candidates) (item items) (actual-size actual-sizes)]
|
||||||
(define npos (+ pos actual-size))
|
(define npos (+ pos actual-size))
|
||||||
(define rpos (round pos))
|
(define rpos (swedish-round pos))
|
||||||
(define size (- (round npos) rpos))
|
(define size (- (swedish-round npos) rpos))
|
||||||
(values npos
|
(values npos
|
||||||
(cons (if vertical?
|
(cons (if vertical?
|
||||||
(tbox-layout item (layout-option-info entry) rpos left width size)
|
(tbox-layout item (layout-option-info entry) rpos left width size)
|
||||||
|
|
Loading…
Reference in New Issue