fix: don't ever draw glyphs outside of the bounds
This commit is contained in:
parent
a54a8b79e0
commit
06e9017079
1 changed files with 3 additions and 1 deletions
|
|
@ -1985,7 +1985,9 @@ where
|
|||
|
||||
// Align contents of the button to the requested `button_alignment`.
|
||||
{
|
||||
let actual_width = state.internal_layout[nth].1.width;
|
||||
// Avoid shifting content outside the left edge when the measured content is
|
||||
// wider than the available button bounds (for example, non-ellipsized text).
|
||||
let actual_width = state.internal_layout[nth].1.width.min(bounds.width);
|
||||
|
||||
let offset = match self.button_alignment {
|
||||
Alignment::Start => None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue