mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
For Auto Size area type in columns, every text edit, each keystroke of the Type tool included, laid the text out in one column and then laid the columns out at that height and at each step of a bisection for the least height that holds the text. In the release-build timing test auto_height_in_columns_typing_timing (stories of 5,000 to 50,000 characters at 9 pt in a frame 500 pt wide), a keystroke laid the columns out 18 to 22 times, and typing at the start of the story of 50,000 characters in 2 columns took 1,670 ms a keystroke. The bisection now runs on the lines of the one-column layout. columns_hold computes where those lines would sit in the columns, with each column's first line at its first baseline below the column's top (LineInfo::first_baseline, new in vectorcraft-text). The columns are then laid out at the upper height the bisection ends on and, when they hold the text there, at the lower one, unless that is the 1 pt it starts from. When they hold the text at the upper height and not at the lower one, Auto Size takes the upper height. When taller columns always hold the text, the old search ends between the same two heights. When the text wraps around other objects or does not fit the one-column layout, or when that check fails, the columns are laid out at every step as before. The same keystroke now takes 292 ms. Docs: docs/target-app-parity.md.