Skip to content

Commit

Permalink
Round inline layout width up to nearest pixel
Browse files Browse the repository at this point in the history
This prevents incorrect wrapping due to float precision issues in
subsequent relayouts with the computed size.
  • Loading branch information
nicoburns committed Jan 24, 2025
1 parent e70eda0 commit a1c00e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/blitz-dom/src/layout/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl BaseDocument {
// println!("\n");

inputs.known_dimensions.unwrap_or(taffy::Size {
width: inline_layout.layout.width() / scale,
width: inline_layout.layout.width().ceil() / scale,
height: inline_layout.layout.height() / scale,
})
},
Expand Down

0 comments on commit a1c00e0

Please sign in to comment.