From be4dc2749caa0e62bbf238768d16323314fd0c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 15 Dec 2022 16:16:26 +0100 Subject: [PATCH] Fix line width in `LayoutLine` for RTL --- src/shape.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shape.rs b/src/shape.rs index d0a928b..aeb4577 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -594,7 +594,7 @@ impl ShapeLine { mem::swap(&mut glyphs, &mut glyphs_swap); layout_lines.push( LayoutLine { - w: x, + w: if self.rtl { start_x - x } else { x }, glyphs: glyphs_swap, }, ); @@ -624,7 +624,7 @@ impl ShapeLine { mem::swap(&mut glyphs, &mut glyphs_swap); layout_lines.push( LayoutLine { - w: x, + w: if self.rtl { start_x - x } else { x }, glyphs: glyphs_swap, }, ); @@ -652,7 +652,7 @@ impl ShapeLine { mem::swap(&mut glyphs, &mut glyphs_swap); layout_lines.push( LayoutLine { - w: x, + w: if self.rtl { start_x - x } else { x }, glyphs: glyphs_swap, }, ); @@ -666,7 +666,7 @@ impl ShapeLine { if push_line { layout_lines.push( LayoutLine { - w: x, + w: if self.rtl { start_x - x } else { x }, glyphs, }, );