update method

  1. @override
void update(
  1. int dirt
)
override

Implementation

@override
void update(int dirt) {
  if (vertexDeform != null &&
      (dirt & vertexDeformDirty) == vertexDeformDirty) {
    int readIdx = 0;
    for (final PathPoint point in _points) {
      point.translation[0] = vertexDeform[readIdx++];
      point.translation[1] = vertexDeform[readIdx++];
      switch (point.pointType) {
        case PointType.straight:
          (point as StraightPathPoint).radius = vertexDeform[readIdx++];
          break;

        default:
          CubicPathPoint cubicPoint = point as CubicPathPoint;
          cubicPoint.inPoint[0] = vertexDeform[readIdx++];
          cubicPoint.inPoint[1] = vertexDeform[readIdx++];
          cubicPoint.outPoint[0] = vertexDeform[readIdx++];
          cubicPoint.outPoint[1] = vertexDeform[readIdx++];
          break;
      }
    }
  }
  invalidateDrawable();

  super.update(dirt);
}