News for hackers. Stuff that matters.
Re:Line breaking (2014) by amelius on Saturday March 03, 2018 @07:31PM (#16512589)
> there's no need to look for good enough, there's already a nice n log n solution.

How efficient is that under local changes? E.g., when the user (or javascript) changes one word in a long paragraph, does the algorithm require a re-analysis of the whole paragraph?

Re:Line breaking (2014) by yorwba on Saturday March 03, 2018 @10:22PM (#16513086)
In the worst case yes, since that might change the number of words that fit in that line, and that would mean exchanging words with the line before or after that, leading to a cascading effect.

However, you might find that many of the old linebreaks can stay as they are, so I'd expect reflowing to be faster in practice.

Re:Line breaking (2014) by amelius on Sunday March 04, 2018 @06:34AM (#16514337)
I'm thinking the algorithm will then not be able to provide a responsive UI in all cases, so perhaps browsers should allow for a temporary suboptimal rendering.