feat: 绘制过程中,撤销上一个point

This commit is contained in:
liqikun 2024-05-28 11:43:38 +08:00
parent 7d75b6414e
commit 311792e54b

View File

@ -35,6 +35,25 @@ export default class Polygon extends Base {
}
}
/**
* backout the last point
*/
removePoint() {
if (this.points.length > 0) {
this.points.pop();
this.setGeometryPoints(this.points);
if (this.points.length === 2) {
this.addTempLine();
} else {
this.removeTempLine();
this.drawPolygon();
}
if(this.points.length === 0) {
this.removeMoveListener();
}
}
}
/**
* Compare whether the positions of two points are equal.
*/