-
Notifications
You must be signed in to change notification settings - Fork 41
Description
After #251, I noticed that trailing whitespace still shows up at the end of lines that end on a forced line break.
#[test]
fn trailing_whitespace() {
let mut env = testenv!();
let text = "AAA \nBBB";
let mut builder = env.builder(text);
let mut layout = builder.build(text);
layout.break_all_lines(None);
layout.align(None, Alignment::Start, false);
env.check_layout_snapshot(&layout);
}
With my patch that shows the padding, this renders the following image.
Patch
diff --git a/parley/src/tests/utils/renderer.rs b/parley/src/tests/utils/renderer.rs
index 2169eb7..a5d6736 100644
--- a/parley/src/tests/utils/renderer.rs
+++ b/parley/src/tests/utils/renderer.rs
@@ -61,6 +61,15 @@ pub(crate) fn render_layout(
let mut pen = TinySkiaPen::new(img.as_mut());
+ draw_rect(
+ &mut pen,
+ fpadding,
+ fpadding,
+ width as f32,
+ height as f32,
+ Color::from_rgba8(220, 220, 220, 255),
+ );
+
for rect in selection_rects {
draw_rect(
&mut pen,
Metadata
Metadata
Assignees
Labels
No labels