Skip to content

Commit e7a038b

Browse files
committed
Add advance to box yield
1 parent 632bfca commit e7a038b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

parley/src/layout/line/greedy.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub struct BoxBreakData {
6868
pub inline_box_id: u64,
6969
// The index of the inline box within the inline_boxes `Vec`
7070
pub inline_box_index: usize,
71+
pub advance: f32,
7172
}
7273

7374
#[derive(Clone, Default)]
@@ -312,6 +313,7 @@ impl<'a, B: Brush> BreakLines<'a, B> {
312313
return Some(YieldData::InlineBoxBreak(BoxBreakData {
313314
inline_box_id: inline_box.id,
314315
inline_box_index: item.index,
316+
advance: self.state.line.x,
315317
}));
316318
}
317319

parley/src/layout/line/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl<'a, B: Brush> Iterator for GlyphRunIter<'a, B> {
285285
glyph_start,
286286
glyph_count,
287287
offset: offset
288-
// + self.line.data.metrics.inline_min_coord
288+
+ self.line.data.metrics.inline_min_coord
289289
+ self.line.data.metrics.offset,
290290
baseline: self.line.data.metrics.baseline,
291291
advance,

0 commit comments

Comments
 (0)