Browse Source

Added Rectangle::toDouble() method

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

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

@@ -700,6 +700,16 @@ public:
static_cast<float> (w), static_cast<float> (h)); static_cast<float> (w), static_cast<float> (h));
} }
/** Casts this rectangle to a Rectangle<double>.
Obviously this is mainly useful for rectangles that use integer types.
@see getSmallestIntegerContainer
*/
Rectangle<double> toDouble() const noexcept
{
return Rectangle<double> (static_cast<double> (pos.x), static_cast<double> (pos.y),
static_cast<double> (w), static_cast<double> (h));
}
//============================================================================== //==============================================================================
/** Static utility to intersect two sets of rectangular co-ordinates. /** Static utility to intersect two sets of rectangular co-ordinates.
Returns false if the two regions didn't overlap. Returns false if the two regions didn't overlap.


Loading…
Cancel
Save