traceBolt function

void traceBolt(
  1. Painter p,
  2. List<Point2> pts,
  3. int c, [
  4. double a = 1.0,
  5. int from = 0,
  6. int? to,
])

Implementation

void traceBolt(
  Painter p,
  List<Point2> pts,
  int c, [
  double a = 1.0,
  int from = 0,
  int? to,
]) {
  final end = math.min(to ?? pts.length - 1, pts.length - 1);
  for (var i = math.max(0, from); i < end; i++) {
    p.line(pts[i].$1, pts[i].$2, pts[i + 1].$1, pts[i + 1].$2, c, a);
  }
}