summaryrefslogtreecommitdiffstats
path: root/core/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-12-01 16:04:27 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-12-01 16:04:27 +0100
commit936d480267578d7e80675e78ec1880aaaaab72d6 (patch)
tree70719766c67dd6a09630c5a4231e952a3200bea1 /core/src/text.rs
parent99899d49cc93cdec3832f7b5ecad867fdd421e07 (diff)
downloadiced-936d480267578d7e80675e78ec1880aaaaab72d6.tar.gz
iced-936d480267578d7e80675e78ec1880aaaaab72d6.tar.bz2
iced-936d480267578d7e80675e78ec1880aaaaab72d6.zip
Clip text to `viewport` bounds instead of layout bounds
Diffstat (limited to 'core/src/text.rs')
-rw-r--r--core/src/text.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/text.rs b/core/src/text.rs
index 546d0b5c..697fa628 100644
--- a/core/src/text.rs
+++ b/core/src/text.rs
@@ -9,7 +9,7 @@ pub use highlighter::Highlighter;
pub use paragraph::Paragraph;
use crate::alignment;
-use crate::{Color, Pixels, Point, Size};
+use crate::{Color, Pixels, Point, Rectangle, Size};
use std::borrow::Cow;
use std::hash::{Hash, Hasher};
@@ -202,6 +202,7 @@ pub trait Renderer: crate::Renderer {
text: &Self::Paragraph,
position: Point,
color: Color,
+ viewport: Rectangle,
);
/// Draws the given [`Editor`] at the given position and with the given
@@ -211,6 +212,7 @@ pub trait Renderer: crate::Renderer {
editor: &Self::Editor,
position: Point,
color: Color,
+ viewport: Rectangle,
);
/// Draws the given [`Text`] at the given position and with the given
@@ -220,5 +222,6 @@ pub trait Renderer: crate::Renderer {
text: Text<'_, Self::Font>,
position: Point,
color: Color,
+ viewport: Rectangle,
);
}