toPath method

Path toPath(
  1. double t,
  2. Path path
)

Resets path to the shape at progress t and returns it.

Implementation

Path toPath(double t, Path path) {
  path.reset();
  if (_a.isEmpty) return path;
  final a = _a;
  final b = _b;
  double l(int i) => a[i] + (b[i] - a[i]) * t;
  path.moveTo(l(0), l(1));
  for (var i = 0; i < a.length; i += 8) {
    path.cubicTo(l(i + 2), l(i + 3), l(i + 4), l(i + 5), l(i + 6), l(i + 7));
  }
  return path..close();
}