This commit is contained in:
2025-12-10 17:28:33 +08:00
33 changed files with 483 additions and 188 deletions

View File

@ -21,7 +21,7 @@ class Submerge extends Tools {
this.currentWaterLaver
this.color = '#00d9ff66'
this.Dialog = _Dialog
this.Draw = new DrawPolygon(this.sdk)
this.Draw = new DrawPolygon(this.sdk, { tipText: '左键单击确定控制点位置,右键单击取消范围绘制! CTRL+右键单击撤销上一个控制点' })
this.positions
this.status = true
this.area = 0
@ -36,23 +36,15 @@ class Submerge extends Tools {
static create(that, func) {
that.Draw.start((a, positions) => {
if (!positions || positions.length < 3) {
let _error = '至少需要三个坐标!'
that.tools.message({
text: _error,
type: 'warning',
});
if (a >= 3) {
that.Draw.tipText = '左键单击确定控制点位置,右键单击结束范围绘制! CTRL+右键单击撤销'
}
else {
that.Draw.tipText = '左键单击确定控制点位置,右键单击取消范围绘制! CTRL+右键单击撤销上一个控制点'
}
return
}
that.destroy()
if (!positions || positions.length == 0) {
that.positions = []
that._positions = []
that.options.minWaterLevel = 0
that.options.maxWaterLevel = 0
that.options.waterVolume = 0
that.area = 0
return
}
let fromDegreesArray = []
that.positions = positions
that._positions = positions