Restrict text width & height to prevent overflow

This commit is contained in:
Cory Forsstrom 2022-04-27 09:13:11 -07:00
parent bc8b4bb182
commit d562c27e8c

View file

@ -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,