summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2024-09-27 08:58:33 -0700
committerLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2024-09-27 08:58:33 -0700
commit509a0a574a2aa343643dfea63eb154ea46c4ef7f (patch)
tree7a354ef6023461f90faa6fc242ee1e600a5e5d3e /core
parent75548373a761d66df364494267c89697dda91fbe (diff)
downloadiced-509a0a574a2aa343643dfea63eb154ea46c4ef7f.tar.gz
iced-509a0a574a2aa343643dfea63eb154ea46c4ef7f.tar.bz2
iced-509a0a574a2aa343643dfea63eb154ea46c4ef7f.zip
Don't fill out of viewport text
Diffstat (limited to 'core')
-rw-r--r--core/src/widget/text.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs
index 8b02f8c2..813b4be8 100644
--- a/core/src/widget/text.rs
+++ b/core/src/widget/text.rs
@@ -334,6 +334,10 @@ pub fn draw<Renderer>(
{
let bounds = layout.bounds();
+ if !bounds.intersects(viewport) {
+ return;
+ }
+
let x = match paragraph.horizontal_alignment() {
alignment::Horizontal::Left => bounds.x,
alignment::Horizontal::Center => bounds.center_x(),