1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Line: Avoid data loss warning in Line::findNearestPointTo

This commit is contained in:
reuk 2024-04-29 15:36:49 +01:00
parent 5ff13aa6b1
commit 0f0095091b
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -323,7 +323,8 @@ public:
*/
Point<ValueType> findNearestPointTo (Point<ValueType> point) const noexcept
{
return getPointAlongLineProportionally (findNearestProportionalPositionTo (point));
using FloatType = typename Point<ValueType>::FloatType;
return getPointAlongLineProportionally ((FloatType) findNearestProportionalPositionTo (point));
}
/** Returns true if the given point lies above this line.