1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

Refactoring of some glypharrangement code.

This commit is contained in:
jules 2013-06-15 19:27:34 +01:00
parent 49fd486c23
commit fc79df875f
8 changed files with 46 additions and 107 deletions

View file

@ -2178,12 +2178,6 @@ void LookAndFeel::drawTabButtonText (TabBarButton& button, Graphics& g, bool isM
Font font (depth * 0.6f);
font.setUnderline (button.hasKeyboardFocus (false));
GlyphArrangement textLayout;
textLayout.addFittedText (font, button.getButtonText().trim(),
0.0f, 0.0f, (float) length, (float) depth,
Justification::centred,
jmax (1, ((int) depth) / 12));
AffineTransform t;
switch (button.getTabbedButtonBar().getOrientation())
@ -2209,7 +2203,13 @@ void LookAndFeel::drawTabButtonText (TabBarButton& button, Graphics& g, bool isM
const float alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;
g.setColour (col.withMultipliedAlpha (alpha));
textLayout.draw (g, t);
g.setFont (font);
g.addTransform (t);
g.drawFittedText (button.getButtonText().trim(),
0.0f, 0.0f, (float) length, (float) depth,
Justification::centred,
jmax (1, ((int) depth) / 12));
}
void LookAndFeel::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)