File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ pub fn layout(fonts: &mut FontsImpl, job: Arc<LayoutJob>) -> Galley {
113
113
let justify_row = justify && !placed_row. ends_with_newline && !is_last_row;
114
114
halign_and_justify_row (
115
115
point_scale,
116
- Arc :: get_mut ( & mut placed_row. row ) . unwrap ( ) ,
116
+ placed_row,
117
117
job. halign ,
118
118
job. wrap . max_width ,
119
119
justify_row,
@@ -512,11 +512,13 @@ fn replace_last_glyph_with_overflow_character(
512
512
/// Ignores the Y coordinate.
513
513
fn halign_and_justify_row (
514
514
point_scale : PointScale ,
515
- row : & mut Row ,
515
+ placed_row : & mut PlacedRow ,
516
516
halign : Align ,
517
517
wrap_width : f32 ,
518
518
justify : bool ,
519
519
) {
520
+ let row = Arc :: get_mut ( & mut placed_row. row ) . unwrap ( ) ;
521
+
520
522
if row. glyphs . is_empty ( ) {
521
523
return ;
522
524
}
@@ -584,7 +586,8 @@ fn halign_and_justify_row(
584
586
/ ( num_spaces_in_range as f32 ) ;
585
587
}
586
588
587
- let mut translate_x = target_min_x - original_min_x - extra_x_per_glyph * glyph_range. 0 as f32 ;
589
+ placed_row. pos . x = point_scale. round_to_pixel ( target_min_x) ;
590
+ let mut translate_x = -original_min_x - extra_x_per_glyph * glyph_range. 0 as f32 ;
588
591
589
592
for glyph in & mut row. glyphs {
590
593
glyph. pos . x += translate_x;
You can’t perform that action at this time.
0 commit comments