Use swedish rounding

This commit is contained in:
Tony Garnock-Jones 2016-09-12 19:14:05 -04:00
parent 6a8c26b364
commit aa992e5063
1 changed files with 5 additions and 2 deletions

View File

@ -276,6 +276,9 @@
[_ (sizing-ideal s)]))
sizings))))
(define (swedish-round x)
(floor (+ x 1/2)))
(define (compute-concrete-adjacent-layout vertical? items candidates top left width height)
(define actual-sizes
(if vertical?
@ -285,8 +288,8 @@
(for/fold [(pos (if vertical? top left)) (entries-rev '())]
[(entry candidates) (item items) (actual-size actual-sizes)]
(define npos (+ pos actual-size))
(define rpos (round pos))
(define size (- (round npos) rpos))
(define rpos (swedish-round pos))
(define size (- (swedish-round npos) rpos))
(values npos
(cons (if vertical?
(tbox-layout item (layout-option-info entry) rpos left width size)