Slightly improve column layouting (overflow) behaviour

pull/1/head
Lennart Spitzner 2016-08-04 11:17:46 +02:00
parent fb2483242a
commit c6eb7a71b8
1 changed files with 7 additions and 4 deletions

View File

@ -1307,8 +1307,11 @@ layoutBriDocM = \case
-- in each column. but in that line, in the last column, we will be
-- forced to occupy the full vertical space, not reduced by any factor.
let fixedPosXs = if maxX>colMax
then let factor :: Float = fromIntegral (colMax - curX)
then let
factor :: Float =
max 1.0 ( fromIntegral (10 + colMax - curX) -- TODO: remove arbitrary 10..
/ fromIntegral (maxX - curX)
)
offsets = (subtract curX) <$> posXs
fixed = offsets <&> fromIntegral .> (*factor) .> truncate
in fixed <&> (+curX)