|
@@ -53,24 +53,25 @@ export default class AddLine {
|
|
|
}
|
|
|
|
|
|
finish(position) {
|
|
|
- if (
|
|
|
- this.newLine != null &&
|
|
|
- mathUtil.equalPoint(this.startInfo.position, position)
|
|
|
- ) {
|
|
|
- dataService.deleteLine(this.newLine.vectorId);
|
|
|
- } else if (
|
|
|
- listenLayer.modifyPoint &&
|
|
|
- listenLayer.modifyPoint.linkedPointId &&
|
|
|
- this.newLine.getCategory() != VectorCategory.Line.ArrowLine &&
|
|
|
- this.newLine.getCategory() != VectorCategory.Line.GuideLine
|
|
|
- ) {
|
|
|
- pointService.mergePoint(
|
|
|
- this.newLine.endId,
|
|
|
- listenLayer.modifyPoint.linkedPointId
|
|
|
- );
|
|
|
+ if (this.newLine != null) {
|
|
|
+ if (mathUtil.equalPoint(this.startInfo.position, position)) {
|
|
|
+ dataService.deleteLine(this.newLine.vectorId);
|
|
|
+ } else if (
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
+ listenLayer.modifyPoint.linkedPointId &&
|
|
|
+ this.newLine.getCategory() != VectorCategory.Line.ArrowLine &&
|
|
|
+ this.newLine.getCategory() != VectorCategory.Line.GuideLine
|
|
|
+ ) {
|
|
|
+ pointService.mergePoint(
|
|
|
+ this.newLine.endId,
|
|
|
+ listenLayer.modifyPoint.linkedPointId
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.newLine.getCategory() == VectorCategory.Line.BaseLine) {
|
|
|
+ Settings.baseLineId = this.newLine.vectorId;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
clearVectorData() {
|
|
|
this.newLine = null;
|
|
|
this.startInfo = {};
|