The label to wrap. An empty string wraps to a single empty line, so the caller always has at least one line to measure and draw.
The widest a line may be, in the same screen-pixel units as estimateTextWidth.
Passed through to estimateTextWidth for each candidate line.
Passed through to estimateTextWidth.
One or more lines, in order.
Breaks a label into lines that each fit within
maxWidth, so a long one — a leaf's statement, in particular — wraps into a block near its node instead of a single line wide enough to run through whatever else is on the canvas.Greedy word wrap: a word is added to the current line as long as the line still fits, and moved to a new one the moment it would not. A single word wider than
maxWidthon its own is left whole on its own line rather than split — this wraps prose, not code, and breaking a word mid-letter would read worse than one slightly wide line.