summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Maja Kądziołka <maya@compilercrim.es>2024-08-03 20:32:51 +0200
committerLibravatar Maja Kądziołka <maya@compilercrim.es>2024-08-03 20:32:51 +0200
commit4d849aaf0bded82b728b9470bb41203b49cc4db2 (patch)
treee7ef555d78ceb87cf766713fa6bc996e0077d078
parent169667ef1b4fa754ed1edb5fa0e845aede2638fb (diff)
downloadiced-4d849aaf0bded82b728b9470bb41203b49cc4db2.tar.gz
iced-4d849aaf0bded82b728b9470bb41203b49cc4db2.tar.bz2
iced-4d849aaf0bded82b728b9470bb41203b49cc4db2.zip
text_editor: Avoid rendering text outside the border
If the height could fit slightly less than an extra line, said line would protrude beyond the border of the text editor.
-rw-r--r--widget/src/text_editor.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index a264ba06..8b4b892d 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -729,7 +729,7 @@ where
defaults: &renderer::Style,
layout: Layout<'_>,
cursor: mouse::Cursor,
- viewport: &Rectangle,
+ _viewport: &Rectangle,
) {
let bounds = layout.bounds();
@@ -793,7 +793,7 @@ where
},
position,
style.placeholder,
- *viewport,
+ bounds,
);
}
} else {
@@ -801,7 +801,7 @@ where
&internal.editor,
position,
defaults.text_color,
- *viewport,
+ bounds,
);
}