mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Avoided an assertion in LookAndFeel_V2 with small TextButtons
This commit is contained in:
parent
c4cdec7bd9
commit
ef98ae9ced
1 changed files with 5 additions and 6 deletions
|
|
@ -265,13 +265,12 @@ void LookAndFeel_V2::drawButtonText (Graphics& g, TextButton& button, bool /*isM
|
|||
const int fontHeight = roundToInt (font.getHeight() * 0.6f);
|
||||
const int leftIndent = jmin (fontHeight, 2 + cornerSize / (button.isConnectedOnLeft() ? 4 : 2));
|
||||
const int rightIndent = jmin (fontHeight, 2 + cornerSize / (button.isConnectedOnRight() ? 4 : 2));
|
||||
const int textWidth = button.getWidth() - leftIndent - rightIndent;
|
||||
|
||||
g.drawFittedText (button.getButtonText(),
|
||||
leftIndent,
|
||||
yIndent,
|
||||
button.getWidth() - leftIndent - rightIndent,
|
||||
button.getHeight() - yIndent * 2,
|
||||
Justification::centred, 2);
|
||||
if (textWidth > 0)
|
||||
g.drawFittedText (button.getButtonText(),
|
||||
leftIndent, yIndent, textWidth, button.getHeight() - yIndent * 2,
|
||||
Justification::centred, 2);
|
||||
}
|
||||
|
||||
void LookAndFeel_V2::drawTickBox (Graphics& g, Component& component,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue