From 275b4e71b35825c820fba57e3a52d3d7ba691920 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 28 Jan 2026 18:50:02 +0800
Subject: [PATCH] feat:椭圆及缓冲圆绘制逻辑调整

---
 applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawEllipseTool.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawEllipseTool.js b/applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawEllipseTool.js
index 5181475..724288c 100644
--- a/applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawEllipseTool.js
+++ b/applications/drone-command/src/views/areaManage/partition/shapeTools/draw/DrawEllipseTool.js
@@ -25,6 +25,7 @@
 		this.semiMinor = 0
 		this.isDrawing = false
 		this.drawStep = 0
+		this.isCompleted = false
 		this.style = resolveStyle(options?.style)
 	}
 
@@ -35,10 +36,12 @@
 		this.handler.setInputAction(click => this.handleLeftClick(click), Cesium.ScreenSpaceEventType.LEFT_CLICK)
 		this.handler.setInputAction(movement => this.handleMouseMove(movement), Cesium.ScreenSpaceEventType.MOUSE_MOVE)
 		this.drawStep = 0
+		this.isCompleted = false
 		this.tooltip.show('单击设置中心点', { x: 0, y: 0 })
 	}
 
 	handleLeftClick(click) {
+		if (this.isCompleted) return
 		const position = this.getPositionFromScreen(click.position)
 		if (!position) return
 		if (this.drawStep === 0) {
@@ -65,6 +68,7 @@
 			this.semiMinor = Math.min(minorRadius, this.semiMajor)
 			this.isDrawing = false
 			this.drawStep = 0
+			this.isCompleted = true
 			const positions = buildEllipsePositions(this.centerCartesian, this.semiMajor, this.semiMinor)
 			this.notify('getPolygonPositions', positions)
 			this.tooltip.hide()
@@ -73,6 +77,7 @@
 	}
 
 	handleMouseMove(movement) {
+		if (this.isCompleted) return
 		this.tooltip.move(movement.endPosition)
 		if (!this.isDrawing) return
 		const position = this.getPositionFromScreen(movement.endPosition)
@@ -152,5 +157,6 @@
 		this.minorPoint = null
 		this.isDrawing = false
 		this.drawStep = 0
+		this.isCompleted = false
 	}
 }

--
Gitblit v1.9.3