Skip to content

Commit 5238fff

Browse files
committed
Round content widths up
1 parent 8939749 commit 5238fff

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

parley/src/layout/data.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ impl<B: Brush> LayoutData<B> {
529529
}
530530

531531
ContentWidths {
532-
min: min_width,
533-
max: max_width,
532+
min: min_width.ceil(),
533+
max: max_width.ceil(),
534534
}
535535
}
536536
}

parley/src/tests/test_basic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use peniko::kurbo::Size;
55

6-
use crate::{testenv, util::nearly_eq, Alignment, InlineBox, WhiteSpaceCollapse};
6+
use crate::{testenv, Alignment, InlineBox, WhiteSpaceCollapse};
77

88
#[test]
99
fn plain_multiline_text() {
@@ -270,8 +270,8 @@ fn inbox_content_width() {
270270
layout.align(None, Alignment::Start, false);
271271

272272
assert!(
273-
nearly_eq(layout.width(), layout.max_content_width()),
274-
"Layout should be as wide as the max content width"
273+
layout.width() <= layout.max_content_width(),
274+
"Layout should never be wider than the max content width"
275275
);
276276

277277
env.with_name("trailing_whitespace")

0 commit comments

Comments
 (0)