I see, but you are not reading the doc of the method you used.
The doc talks about line segments for the intersects method that takes a reference to an intersection point as an additional parameter.
The one you use talks about lines.
Just guessing here but worth trying the other method.
Yep, if you use Line<float>, it works fine. Thanks Intrets.
The docs are pretty clearly referring to segments, as is the underlying JUCE code in Line::intersects(). But it doesn’t seem work properly if you are using ints.
Oh I see. The doc is not clear about segments everywhere. But it indeed says:
“The ValueType template parameter should be a primitive type - float or double are what it’s designed for. Integer types will work in a basic way, but some methods that perform mathematical operations may not compile, or they may not produce sensible results.”