rectForRange method
Implementation
Rect? rectForRange(int start, int end) {
Rect? union;
int cursor = 0;
for (final UDocTextRun run in runs) {
final int runEnd = cursor + run.text.length;
if (runEnd > start && cursor < end) union = union == null ? run.rect : union.expandToInclude(run.rect);
cursor = runEnd + 1;
}
return union;
}