From f01784a45c68c1d185b7823da688878286bdb0b4 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:26:50 +0000 Subject: [PATCH] (Slightly) Less broken workarounds for https://github.com/linebender/parley/issues/165 --- masonry/src/widget/prose.rs | 4 +++- xilem/examples/http_cats.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/masonry/src/widget/prose.rs b/masonry/src/widget/prose.rs index 4d6ac633f..c43320903 100644 --- a/masonry/src/widget/prose.rs +++ b/masonry/src/widget/prose.rs @@ -126,7 +126,9 @@ impl Widget for Prose { let size = ctx.run_layout(&mut self.text, bc); ctx.place_child(&mut self.text, Point::ORIGIN); if self.clip { - ctx.set_clip_path(Rect::from_origin_size(Point::ORIGIN, size)); + // Workaround for https://github.com/linebender/parley/issues/165 + let clip_size = Size::new(size.width, size.height + 20.); + ctx.set_clip_path(Rect::from_origin_size(Point::ORIGIN, clip_size)); } size } diff --git a/xilem/examples/http_cats.rs b/xilem/examples/http_cats.rs index fa7de8868..f3dd486dd 100644 --- a/xilem/examples/http_cats.rs +++ b/xilem/examples/http_cats.rs @@ -200,8 +200,9 @@ impl Status { image, // TODO: Overlay on top of the image? // HACK: Trailing padding workaround scrollbar covering content + // HACK: Bottom padding to workaround https://github.com/linebender/parley/issues/165 sized_box(prose("Copyright ©️ https://http.cat").alignment(TextAlignment::End)) - .padding(Padding::trailing(15.)), + .padding(Padding::new(0., 15., 10., 0.)), )) .main_axis_alignment(xilem::view::MainAxisAlignment::Start) }