Browse Source

Added division operator to Rectangle.

tags/2021-05-28
jules 12 years ago
parent
commit
d086d55b44
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      modules/juce_graphics/geometry/juce_Rectangle.h

+ 14
- 0
modules/juce_graphics/geometry/juce_Rectangle.h View File

@@ -310,6 +310,20 @@ public:
return *this;
}
/** Scales this rectangle by the given amount, centred around the origin. */
template <typename FloatType>
Rectangle operator/ (FloatType scaleFactor) const noexcept
{
return operator* (((FloatType) 1) / scaleFactor);
}
/** Scales this rectangle by the given amount, centred around the origin. */
template <typename FloatType>
Rectangle operator/= (FloatType scaleFactor) noexcept
{
return operator*= (((FloatType) 1) / scaleFactor);
}
/** Expands the rectangle by a given amount.
Effectively, its new size is (x - deltaX, y - deltaY, w + deltaX * 2, h + deltaY * 2).


Loading…
Cancel
Save