read static method

ActorPath read(
  1. ActorArtboard artboard,
  2. StreamReader reader,
  3. ActorPath component
)
override

Implementation

static ActorPath read(
    ActorArtboard artboard, StreamReader reader, ActorPath component) {
  ActorNode.read(artboard, reader, component);
  ActorSkinnable.read(artboard, reader, component);

  component._isHidden = !reader.readBool('isVisible');
  component._isClosed = reader.readBool('isClosed');

  reader.openArray('points');
  int pointCount = reader.readUint16Length();
  component._points = <PathPoint>[];
  for (int i = 0; i < pointCount; i++) {
    reader.openObject('point');
    PathPoint point;
    PointType? type = pointTypeLookup[reader.readUint8('pointType')];
    switch (type) {
      case PointType.straight:
        {
          point = StraightPathPoint();
          break;
        }
      default:
        {
          point = CubicPathPoint(type!);
          break;
        }
    }

    point.read(reader, component.isConnectedToBones);

    reader.closeObject();
    component._points.add(point);
  }
  reader.closeArray();
  return component;
}