issueCommands method

void issueCommands(
  1. Path path
)

Implementation

void issueCommands(ui.Path path) {
  for (final command in this) {
    switch (command.verb) {
      case RawPathVerb.move:
        var p = command.point(0);
        path.moveTo(p.x, p.y);
        break;
      case RawPathVerb.line:
        var p = command.point(1);
        path.lineTo(p.x, p.y);
        break;
      case RawPathVerb.quad:
        var p1 = command.point(1);
        var p2 = command.point(2);
        path.quadraticBezierTo(p1.x, p1.y, p2.x, p2.y);

        break;
      case RawPathVerb.cubic:
        var p1 = command.point(1);
        var p2 = command.point(2);
        var p3 = command.point(3);
        path.cubicTo(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
        break;
      case RawPathVerb.close:
        path.close();
        break;
    }
  }
}