mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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:
parent
0aa08042d5
commit
601517e3aa
2 changed files with 7 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue