diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index 96440a5932..13f7c0689c 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -700,6 +700,16 @@ public: static_cast (w), static_cast (h)); } + /** Casts this rectangle to a Rectangle. + Obviously this is mainly useful for rectangles that use integer types. + @see getSmallestIntegerContainer + */ + Rectangle toDouble() const noexcept + { + return Rectangle (static_cast (pos.x), static_cast (pos.y), + static_cast (w), static_cast (h)); + } + //============================================================================== /** Static utility to intersect two sets of rectangular co-ordinates. Returns false if the two regions didn't overlap.