mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Avoided some assertions drawing very small ToggleButtons
This commit is contained in:
parent
0ca253856b
commit
3c43707a54
2 changed files with 4 additions and 8 deletions
|
|
@ -336,11 +336,9 @@ void LookAndFeel_V2::drawToggleButton (Graphics& g, ToggleButton& button,
|
|||
if (! button.isEnabled())
|
||||
g.setOpacity (0.5f);
|
||||
|
||||
const int textX = (int) tickWidth + 5;
|
||||
|
||||
g.drawFittedText (button.getButtonText(),
|
||||
textX, 0,
|
||||
button.getWidth() - textX - 2, button.getHeight(),
|
||||
button.getLocalBounds().withTrimmedLeft (roundToInt (tickWidth) + 5)
|
||||
.withTrimmedRight (2),
|
||||
Justification::centredLeft, 10);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -333,11 +333,9 @@ void LookAndFeel_V4::drawToggleButton (Graphics& g, ToggleButton& button,
|
|||
if (! button.isEnabled())
|
||||
g.setOpacity (0.5f);
|
||||
|
||||
const auto textX = roundToInt (tickWidth) + 10;
|
||||
|
||||
g.drawFittedText (button.getButtonText(),
|
||||
textX, 0,
|
||||
button.getWidth() - textX - 2, button.getHeight(),
|
||||
button.getLocalBounds().withTrimmedLeft (roundToInt (tickWidth) + 10)
|
||||
.withTrimmedRight (2),
|
||||
Justification::centredLeft, 10);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue