Restrict text width & height to prevent overflow
This commit is contained in:
parent
bc8b4bb182
commit
d562c27e8c
1 changed files with 2 additions and 1 deletions
|
|
@ -414,7 +414,8 @@ pub fn draw<T, Renderer>(
|
||||||
bounds: Rectangle {
|
bounds: Rectangle {
|
||||||
x: bounds.x + f32::from(padding.left),
|
x: bounds.x + f32::from(padding.left),
|
||||||
y: bounds.center_y() - text_size / 2.0,
|
y: bounds.center_y() - text_size / 2.0,
|
||||||
..bounds
|
width: bounds.width - f32::from(padding.horizontal()),
|
||||||
|
height: text_size,
|
||||||
},
|
},
|
||||||
horizontal_alignment: alignment::Horizontal::Left,
|
horizontal_alignment: alignment::Horizontal::Left,
|
||||||
vertical_alignment: alignment::Vertical::Top,
|
vertical_alignment: alignment::Vertical::Top,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue