getPoint method
dynamic
getPoint(
- num t,
- dynamic optionalTarget
)
override
Implementation
@override
getPoint(t, optionalTarget) {
var d = t * getLength();
var curveLengths = getCurveLengths();
var i = 0;
// To think about boundaries points.
while (i < curveLengths.length) {
if (curveLengths[i] >= d) {
var diff = curveLengths[i] - d;
var curve = curves[i];
var segmentLength = curve.getLength();
var u = segmentLength == 0 ? 0 : 1 - diff / segmentLength;
return curve.getPointAt(u, optionalTarget);
}
i++;
}
return null;
// loop where sum != 0, sum > d , sum+1 <d
}