Cleanup after #36461 (#36472)

This avoids some minor code duplication.

Testing: not needed (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-04-11 09:35:21 -07:00 committed by GitHub
parent 0aa08042d5
commit 601517e3aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 13 deletions

View file

@ -1233,11 +1233,9 @@ fn glyphs_advance_by_index(
let mut point = baseline_origin;
let mut index = index;
for run in glyph_runs {
let total_advance = run.advance_for_byte_range(
&ServoRange::new(fonts::ByteIndex(0), index.min(run.len())),
justification_adjustment,
);
index = index - index.min(run.len());
let range = ServoRange::new(fonts::ByteIndex(0), index.min(run.len()));
index = index - range.length();
let total_advance = run.advance_for_byte_range(&range, justification_adjustment);
point.x += total_advance;
}
point