|
|
@@ -711,7 +711,6 @@ public: |
|
|
|
}
|
|
|
|
|
|
|
|
/** Casts this rectangle to a Rectangle<float>.
|
|
|
|
Obviously this is mainly useful for rectangles that use integer types.
|
|
|
|
@see getSmallestIntegerContainer
|
|
|
|
*/
|
|
|
|
Rectangle<float> toFloat() const noexcept
|
|
|
@@ -721,7 +720,6 @@ public: |
|
|
|
}
|
|
|
|
|
|
|
|
/** 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
|
|
|
@@ -730,6 +728,18 @@ public: |
|
|
|
static_cast<double> (w), static_cast<double> (h));
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Casts this rectangle to a Rectangle with the given type.
|
|
|
|
If the target type is a conversion from float to int, then the conversion
|
|
|
|
will be done using getSmallestIntegerContainer().
|
|
|
|
*/
|
|
|
|
template <typename TargetType>
|
|
|
|
Rectangle<TargetType> toType() const noexcept
|
|
|
|
{
|
|
|
|
Rectangle<TargetType> r;
|
|
|
|
copyWithRounding (r);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Returns the smallest Rectangle that can contain a set of points. */
|
|
|
|
static Rectangle findAreaContainingPoints (const Point<ValueType>* const points, const int numPoints) noexcept
|
|
|
|
{
|
|
|
|