Browse Source

Added a method Range::expanded()

tags/2021-05-28
jules 9 years ago
parent
commit
332dcac07d
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      modules/juce_core/maths/juce_Range.h

+ 9
- 0
modules/juce_core/maths/juce_Range.h View File

@@ -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


Loading…
Cancel
Save