diff --git a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp index b17e40e1dd..6ab35f91e8 100644 --- a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp +++ b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp @@ -567,7 +567,7 @@ IntrojucerLookAndFeel::IntrojucerLookAndFeel() Rectangle IntrojucerLookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component) { if (component.findParentComponentOfClass() != nullptr) - return component.getLocalBounds().reduced (1, 1).removeFromRight (component.getWidth() / 2); + return component.getLocalBounds().reduced (1).removeFromRight (component.getWidth() / 2); return LookAndFeel::getPropertyComponentContentPosition (component); } diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h index 57105775ce..7656c914bf 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h @@ -280,7 +280,7 @@ public: const Colour colour (getColour()); g.fillAll (Colours::grey); - g.fillCheckerBoard (getLocalBounds().reduced (2, 2), + g.fillCheckerBoard (getLocalBounds().reduced (2), 10, 10, Colour (0xffdddddd).overlaidWith (colour), Colour (0xffffffff).overlaidWith (colour)); diff --git a/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp b/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp index f59f29380e..ef2ffc9665 100644 --- a/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp +++ b/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp @@ -94,7 +94,7 @@ public: if (thumbnail.getTotalLength() > 0) { - thumbnail.drawChannels (g, getLocalBounds().reduced (2, 2), + thumbnail.drawChannels (g, getLocalBounds().reduced (2), startTime, endTime, 1.0f); } else diff --git a/extras/JuceDemo/Source/demos/WidgetsDemo.cpp b/extras/JuceDemo/Source/demos/WidgetsDemo.cpp index 7739bca00f..fdb8c21c83 100644 --- a/extras/JuceDemo/Source/demos/WidgetsDemo.cpp +++ b/extras/JuceDemo/Source/demos/WidgetsDemo.cpp @@ -940,7 +940,7 @@ public: g.setColour (Colours::green); g.fillPath (p, RectanglePlacement (RectanglePlacement::centred) - .getTransformToFit (p.getBounds(), getLocalBounds().reduced (2, 2).toFloat())); + .getTransformToFit (p.getBounds(), getLocalBounds().reduced (2).toFloat())); } void mouseDown (const MouseEvent&) diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index 9972c35b30..1d853bc1b1 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -319,6 +319,16 @@ public: return Rectangle (pos.x - deltaX, pos.y - deltaY, nw, nh); } + /** Returns a rectangle that is larger than this one by a given amount. + + Effectively, the rectangle returned is (x - delta, y - delta, w + delta * 2, h + delta * 2). + @see expand, reduce, reduced + */ + Rectangle expanded (const ValueType delta) const noexcept + { + return expanded (delta, delta); + } + /** Shrinks the rectangle by a given amount. Effectively, its new size is (x + deltaX, y + deltaY, w - deltaX * 2, h - deltaY * 2). @@ -341,6 +351,16 @@ public: return expanded (-deltaX, -deltaY); } + /** Returns a rectangle that is smaller than this one by a given amount. + + Effectively, the rectangle returned is (x + delta, y + delta, w - delta * 2, h - delta * 2). + @see reduce, expand, expanded + */ + Rectangle reduced (const ValueType delta) const noexcept + { + return reduced (delta, delta); + } + /** Removes a strip from the top of this rectangle, reducing this rectangle by the specified amount and returning the section that was removed.