From 0f0095091bcff2f1c9a54fa131ea257dacdd8fea Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 29 Apr 2024 15:36:49 +0100 Subject: [PATCH] Line: Avoid data loss warning in Line::findNearestPointTo --- modules/juce_graphics/geometry/juce_Line.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/juce_graphics/geometry/juce_Line.h b/modules/juce_graphics/geometry/juce_Line.h index c4463f5b64..ce07dc4903 100644 --- a/modules/juce_graphics/geometry/juce_Line.h +++ b/modules/juce_graphics/geometry/juce_Line.h @@ -323,7 +323,8 @@ public: */ Point findNearestPointTo (Point point) const noexcept { - return getPointAlongLineProportionally (findNearestProportionalPositionTo (point)); + using FloatType = typename Point::FloatType; + return getPointAlongLineProportionally ((FloatType) findNearestProportionalPositionTo (point)); } /** Returns true if the given point lies above this line.