export class PolylinePainter {
  points = [];
  historyStask = [];
  undo() {
    if (this.historyStask.length > 0) {
      this.historyStask.pop();
      this.points = this.historyStask.at(-1) || [];
      this.onChange?.(this.points);
    }
  }
  addPoint(position) {
    this.points.push(position);
    this.historyStask.push([...this.points]);
    this.onChange?.(this.points);
  }
  getData() {
    if (this.points.length < 2) {
      return false;
    }
    return this.points;
  }
}
//# sourceMappingURL=PolylinePainter.js.map