Merge pull request #191 from dovreshef/fix_rtl_issue_190

Fix rendering of RTL words
This commit is contained in:
Jeremy Soller 2023-09-23 11:38:59 -06:00 committed by GitHub
commit e2adc1e8da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1221,11 +1221,12 @@ impl ShapeLine {
} else {
0.0
};
let y_advance = font_size * glyph.y_advance;
glyphs.push(glyph.layout(font_size, x, y, x_advance, span.level));
if self.rtl {
x -= x_advance;
} else {
}
let y_advance = font_size * glyph.y_advance;
glyphs.push(glyph.layout(font_size, x, y, x_advance, span.level));
if !self.rtl {
x += x_advance;
}
y += y_advance;