diff --git a/modules/juce_graphics/geometry/juce_BorderSize.h b/modules/juce_graphics/geometry/juce_BorderSize.h index fdbb4480d5..8f954a7683 100644 --- a/modules/juce_graphics/geometry/juce_BorderSize.h +++ b/modules/juce_graphics/geometry/juce_BorderSize.h @@ -67,13 +67,13 @@ public: /** Returns the gap that should be left at the top of the region. */ ValueType getTop() const noexcept { return top; } - /** Returns the gap that should be left at the top of the region. */ + /** Returns the gap that should be left at the left of the region. */ ValueType getLeft() const noexcept { return left; } - /** Returns the gap that should be left at the top of the region. */ + /** Returns the gap that should be left at the bottom of the region. */ ValueType getBottom() const noexcept { return bottom; } - /** Returns the gap that should be left at the top of the region. */ + /** Returns the gap that should be left at the right of the region. */ ValueType getRight() const noexcept { return right; } /** Returns the sum of the top and bottom gaps. */ diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp index bdeea1dcc8..bfbe6d0db7 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp @@ -1243,7 +1243,7 @@ void LookAndFeel_V2::drawLabel (Graphics& g, Label& label) g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha)); g.setFont (font); - auto textArea = label.getBorderSize().subtractedFrom (label.getLocalBounds()); + auto textArea = getLabelBorderSize (label).subtractedFrom (label.getLocalBounds()); g.drawFittedText (label.getText(), textArea, label.getJustificationType(), jmax (1, (int) (textArea.getHeight() / font.getHeight())), @@ -1259,6 +1259,11 @@ void LookAndFeel_V2::drawLabel (Graphics& g, Label& label) g.drawRect (label.getLocalBounds()); } +BorderSize LookAndFeel_V2::getLabelBorderSize (Label& label) +{ + return label.getBorderSize(); +} + //============================================================================== void LookAndFeel_V2::drawLinearSliderBackground (Graphics& g, int x, int y, int width, int height, float /*sliderPos*/, diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h index c0b61a5fa4..5b01782e0a 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h @@ -203,6 +203,7 @@ public: //============================================================================== void drawLabel (Graphics&, Label&) override; Font getLabelFont (Label&) override; + BorderSize getLabelBorderSize (Label&) override; //============================================================================== void drawLinearSlider (Graphics&, int x, int y, int width, int height, diff --git a/modules/juce_gui_basics/widgets/juce_Label.h b/modules/juce_gui_basics/widgets/juce_Label.h index 084bbe3e18..e6f1bf2318 100644 --- a/modules/juce_gui_basics/widgets/juce_Label.h +++ b/modules/juce_gui_basics/widgets/juce_Label.h @@ -280,6 +280,7 @@ public: virtual void drawLabel (Graphics&, Label&) = 0; virtual Font getLabelFont (Label&) = 0; + virtual BorderSize getLabelBorderSize (Label&) = 0; }; protected: