From 664caf7087c779ad6ec652ce4ea8df4168e3d610 Mon Sep 17 00:00:00 2001 From: Konsl <82901383+Konsl@users.noreply.github.com> Date: Tue, 7 Jan 2025 00:30:14 +0100 Subject: [PATCH 1/2] Apply wrapping to paragraphs --- graphics/src/text/paragraph.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphics/src/text/paragraph.rs b/graphics/src/text/paragraph.rs index 07ddbb821a..d1e23c002d 100644 --- a/graphics/src/text/paragraph.rs +++ b/graphics/src/text/paragraph.rs @@ -80,6 +80,8 @@ impl core::text::Paragraph for Paragraph { Some(text.bounds.height), ); + buffer.set_wrap(font_system.raw(), text::to_wrap(text.wrapping)); + buffer.set_text( font_system.raw(), text.content, From bffe572a045af6f06b307dbab300233a476c4d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 10 Jan 2025 23:36:45 +0100 Subject: [PATCH 2/2] Fix text wrapping for `rich_text` --- graphics/src/text/paragraph.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphics/src/text/paragraph.rs b/graphics/src/text/paragraph.rs index d1e23c002d..48c8e9e65f 100644 --- a/graphics/src/text/paragraph.rs +++ b/graphics/src/text/paragraph.rs @@ -124,6 +124,8 @@ impl core::text::Paragraph for Paragraph { Some(text.bounds.height), ); + buffer.set_wrap(font_system.raw(), text::to_wrap(text.wrapping)); + buffer.set_rich_text( font_system.raw(), text.content.iter().enumerate().map(|(i, span)| {