Codechange: Store text run positions in vector of points.

This simplifies the interlaced vector of x/y positions.
This commit is contained in:
Peter Nelson
2024-01-18 21:06:43 +00:00
committed by Peter Nelson
parent f7cc88f370
commit ae575a7a5b
8 changed files with 46 additions and 53 deletions

View File

@@ -599,9 +599,9 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left,
/* Not a valid glyph (empty) */
if (glyph == 0xFFFF) continue;
int begin_x = (int)positions[i * 2] + left - offset_x;
int end_x = (int)positions[i * 2 + 2] + left - offset_x - 1;
int top = (int)positions[i * 2 + 1] + y;
int begin_x = positions[i].x + left - offset_x;
int end_x = positions[i + 1].x + left - offset_x - 1;
int top = positions[i].y + y;
/* Truncated away. */
if (truncation && (begin_x < min_x || end_x > max_x)) continue;