diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index 3469c6c949..d62ed17949 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -364,6 +364,11 @@ inline int roundToInt (const FloatType value) noexcept #endif } +inline int roundToInt (int value) noexcept +{ + return value; +} + #if JUCE_MSVC #ifndef __INTEL_COMPILER #pragma float_control (pop) diff --git a/modules/juce_graphics/geometry/juce_Point.h b/modules/juce_graphics/geometry/juce_Point.h index ffe80fe2fc..7cc5d4990c 100644 --- a/modules/juce_graphics/geometry/juce_Point.h +++ b/modules/juce_graphics/geometry/juce_Point.h @@ -213,6 +213,9 @@ public: /** Casts this point to a Point object. */ Point toDouble() const noexcept { return Point (static_cast (x), static_cast (y)); } + /** Casts this point to a Point object using roundToInt() to convert the values. */ + Point roundToInt() const noexcept { return Point (juce::roundToInt (x), juce::roundToInt (y)); } + /** Returns the point as a string in the form "x, y". */ String toString() const { return String (x) + ", " + String (y); }