"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SGraphPointListUpdate = void 0; const index_1 = require("../index"); class SGraphPointListUpdate extends index_1.SGraphCommand { constructor(scene, item, pointList, old, pos, index) { super(scene); this.item = item; this.old = old; this.pos = pos; this.index = index; this.pointList = pointList; this.command = "SGraphPointListUpdate"; this.desc = `更新折点=${item.id}`; } redo() { this.pointList[this.index].x = this.pos.x; this.pointList[this.index].y = this.pos.y; this.item.update(); } undo() { this.pointList[this.index].x = this.old.x; this.pointList[this.index].y = this.old.y; this.item.update(); } toString() { const pointList = `pointList=${JSON.stringify(this.pointList)}`; const old = `old=${JSON.stringify(this.old)}`; const pos = `pos=${JSON.stringify(this.pos)}`; const index = `index=${this.index}`; return `${index};\n${old};\n${pos};\n${pointList}`; } } exports.SGraphPointListUpdate = SGraphPointListUpdate;