skia /
skia /
c1ba6ca3b53fe47b977f1772b41a6af8c2471eef Paragraph: Add option to exclude trailing space in getRectsForRange
The getRectsForRange method provides rectangles that include any trailing
whitespace on a line. For certain use cases, such as drawing precise
text decorations (e.g., underlines, highlights), a bounding box that
tightly encloses only the visible glyphs is also needed.
This change enhances getRectsForRange with a new option to compute
bounding boxes without the trailing whitespace, supporting these
use cases. The default behavior remains unchanged.
BUG=none
TEST=Added new unit tests for SkParagraph. Ran dm locally.
Change-Id: I77ff19e7c56085044e75d4306c9071ac38ed1aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1029236
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
3 files changed