diff --git a/modules/juce_core/maths/juce_Range.h b/modules/juce_core/maths/juce_Range.h index 67a4324b95..5f9d409e47 100644 --- a/modules/juce_core/maths/juce_Range.h +++ b/modules/juce_core/maths/juce_Range.h @@ -172,6 +172,15 @@ public: return Range (start, start + newLength); } + /** Returns a range which has its start moved down and its end moved up by the + given amount. + @returns The returned range will be (start - amount, end + amount) + */ + Range expanded (ValueType amount) const noexcept + { + return Range (start - amount, end + amount); + } + //============================================================================== /** Adds an amount to the start and end of the range. */ inline Range operator+= (const ValueType amountToAdd) noexcept