fix: make sure line-break algorithm respects available lines
This commit is contained in:
parent
eaf245beaa
commit
e487ceff58
@ -416,7 +416,11 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
|
||||
w = offsets Array.! j - offsets Array.! i
|
||||
prevMin <- ST.readArray minima i
|
||||
let cost = prevMin + widthCost l potWidth w + breakCost'
|
||||
remainingWords = offsets Array.! Map.size wordMap - offsets Array.! i
|
||||
remainingLineSpace = sum (map snd $ drop lineIx lineLengths)
|
||||
breakCost'
|
||||
| remainingWords > remainingLineSpace
|
||||
= PosInf
|
||||
| j < Map.size wordMap
|
||||
, j > 0
|
||||
= breakCost (wordIx # pred j) (wordIx # j)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user