Hi,
I have noticed a bug I cannot seem to track down in the Line(int) function getPointAlongLine(). It seems to be only returning the start point of the line for any distance value. Below is some demo code, and the printout of that code.
This works as expected with Line(float)
Any help would be appreciated!
Thanks,
Chris
juce::Line<int> line = juce::Line<int>({0, 0}, {10, 10});
int dist = line.getLength();
int interp = 1;
int currentDist = interp;
while (currentDist < dist)
{
juce::Point<int> point = line.getPointAlongLine(currentDist);
DBG("Point: " << point.toString() << " Dist: " << currentDist << " Length: " << dist);
currentDist += interp;
}
DBG Produces:
JUCE v6.0.5
Point: 0, 0 Dist: 1 Length: 14
Point: 0, 0 Dist: 2 Length: 14
Point: 0, 0 Dist: 3 Length: 14
Point: 0, 0 Dist: 4 Length: 14
Point: 0, 0 Dist: 5 Length: 14
Point: 0, 0 Dist: 6 Length: 14
Point: 0, 0 Dist: 7 Length: 14
Point: 0, 0 Dist: 8 Length: 14
Point: 0, 0 Dist: 9 Length: 14
Point: 0, 0 Dist: 10 Length: 14
Point: 0, 0 Dist: 11 Length: 14
Point: 0, 0 Dist: 12 Length: 14
Point: 0, 0 Dist: 13 Length: 14
