Skip to content

Commit

Permalink
fix actualBoundingBox vertical limits
Browse files Browse the repository at this point in the history
- the 0,0 origin of the empty bounding box was being included even when the baseline selection pushed the origin outside of the text run's bounds
  • Loading branch information
samizdatco committed Jan 27, 2025
1 parent a6b4dd4 commit 707341b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/typography.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ impl Typesetter{
line_rect.bottom = used_rect.bottom;

// build up union of line_rects to find the bounds for the whole text run
bounds.join_possibly_empty_rect(line_rect);
bounds = match bounds.is_empty(){
false => Rect::join2(bounds, line_rect),
true => line_rect,
};

// find the character range of the line's content in the source string
let line_end = if self.width==GALLEY{ line.end_index }else{ line.end_excluding_whitespaces };
Expand Down

0 comments on commit 707341b

Please sign in to comment.