From f98328f4f1ee58b6288e4f19d7475e7eeb9a7ba7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 4 Sep 2024 21:25:59 +0200 Subject: Add `text::Wrapping` support Co-authored-by: Neeraj Jaiswal --- core/src/text/editor.rs | 3 ++- core/src/text/paragraph.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'core/src/text') diff --git a/core/src/text/editor.rs b/core/src/text/editor.rs index 135707d1..cd30db3a 100644 --- a/core/src/text/editor.rs +++ b/core/src/text/editor.rs @@ -1,6 +1,6 @@ //! Edit text. use crate::text::highlighter::{self, Highlighter}; -use crate::text::LineHeight; +use crate::text::{LineHeight, Wrapping}; use crate::{Pixels, Point, Rectangle, Size}; use std::sync::Arc; @@ -50,6 +50,7 @@ pub trait Editor: Sized + Default { new_font: Self::Font, new_size: Pixels, new_line_height: LineHeight, + new_wrapping: Wrapping, new_highlighter: &mut impl Highlighter, ); diff --git a/core/src/text/paragraph.rs b/core/src/text/paragraph.rs index 04a97f35..924276c3 100644 --- a/core/src/text/paragraph.rs +++ b/core/src/text/paragraph.rs @@ -95,6 +95,7 @@ impl Plain

{ horizontal_alignment: text.horizontal_alignment, vertical_alignment: text.vertical_alignment, shaping: text.shaping, + wrapping: text.wrapping, }) { Difference::None => {} Difference::Bounds => { -- cgit