summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2022-04-27 09:13:11 -0700
committerLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2022-04-27 09:24:04 -0700
commitd562c27e8ce10ecf4aed4d5fc4c64a737391c2c9 (patch)
treedee98ff5fd17e8776c0238bdf53f80b075d6a60c
parentbc8b4bb1828a8bd4fa95b585d0655adec8f85f9d (diff)
downloadiced-d562c27e8ce10ecf4aed4d5fc4c64a737391c2c9.tar.gz
iced-d562c27e8ce10ecf4aed4d5fc4c64a737391c2c9.tar.bz2
iced-d562c27e8ce10ecf4aed4d5fc4c64a737391c2c9.zip
Restrict text width & height to prevent overflow
-rw-r--r--native/src/widget/pick_list.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/native/src/widget/pick_list.rs b/native/src/widget/pick_list.rs
index 2e61e036..0374aef7 100644
--- a/native/src/widget/pick_list.rs
+++ b/native/src/widget/pick_list.rs
@@ -414,7 +414,8 @@ pub fn draw<T, Renderer>(
bounds: Rectangle {
x: bounds.x + f32::from(padding.left),
y: bounds.center_y() - text_size / 2.0,
- ..bounds
+ width: bounds.width - f32::from(padding.horizontal()),
+ height: text_size,
},
horizontal_alignment: alignment::Horizontal::Left,
vertical_alignment: alignment::Vertical::Top,