Skip to content

Commit 987ff45

Browse files
authored
Round glyph advance to integer sizes (#384)
This is in line with [1]. [1]: https://skia.googlesource.com/skia/+/refs/heads/chrome/m136/src/ports/SkTypeface_fontations.cpp#539
1 parent b017d7c commit 987ff45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shape.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1559,12 +1559,13 @@ impl ShapeLine {
15591559
_ => font_size,
15601560
};
15611561

1562-
let x_advance = glyph_font_size * glyph.x_advance
1562+
let mut x_advance = glyph_font_size * glyph.x_advance
15631563
+ if word.blank {
15641564
justification_expansion
15651565
} else {
15661566
0.0
15671567
};
1568+
x_advance = x_advance.round();
15681569
if self.rtl {
15691570
x -= x_advance;
15701571
}

0 commit comments

Comments
 (0)