mirror of
https://github.com/ethan-zf/cesium-plot-js.git
synced 2025-06-23 19:17:29 +00:00
修复双箭头整体被拖拽后生长动画路径不正确的问题
This commit is contained in:
parent
c08826089d
commit
c8b7d15d6e
@ -53,8 +53,6 @@ export default class DoubleArrow extends Base {
|
||||
this.lineEntity && this.viewer.entities.remove(this.lineEntity);
|
||||
} else {
|
||||
this.finishDrawing();
|
||||
this.curveControlPointLeft = this.cesium.Cartesian3.fromDegrees(this.llBodyPnts[2][0], this.llBodyPnts[2][1]);
|
||||
this.curveControlPointRight = this.cesium.Cartesian3.fromDegrees(this.rrBodyPnts[1][0], this.rrBodyPnts[1][1]);
|
||||
|
||||
// // 辅助查看插值控制点位置
|
||||
// this.viewer.entities.add({
|
||||
@ -76,11 +74,11 @@ export default class DoubleArrow extends Base {
|
||||
}
|
||||
}
|
||||
|
||||
// finishDrawing() {
|
||||
// this.curveControlPointLeft = this.cesium.Cartesian3.fromDegrees(this.llBodyPnts[2][0], this.llBodyPnts[2][1]);
|
||||
// this.curveControlPointRight = this.cesium.Cartesian3.fromDegrees(this.rrBodyPnts[1][0], this.rrBodyPnts[1][1]);
|
||||
// super.finishDrawing();
|
||||
// }
|
||||
finishDrawing() {
|
||||
this.curveControlPointLeft = this.cesium.Cartesian3.fromDegrees(this.llBodyPnts[2][0], this.llBodyPnts[2][1]);
|
||||
this.curveControlPointRight = this.cesium.Cartesian3.fromDegrees(this.rrBodyPnts[1][0], this.rrBodyPnts[1][1]);
|
||||
super.finishDrawing();
|
||||
}
|
||||
/**
|
||||
* Draw a shape based on mouse movement points during the initial drawing.
|
||||
*/
|
||||
|
@ -441,6 +441,11 @@ export default class Base {
|
||||
});
|
||||
|
||||
this.setGeometryPoints(newPoints);
|
||||
if (this.minPointsForShape === 4) {
|
||||
// 双箭头在整体被拖拽时,需要同步更新生长动画的插值点
|
||||
this.curveControlPointLeft = this.cesium.Cartesian3.add(this.curveControlPointLeft, translation, new this.cesium.Cartesian3());
|
||||
this.curveControlPointRight = this.cesium.Cartesian3.add(this.curveControlPointRight, translation, new this.cesium.Cartesian3());
|
||||
}
|
||||
startPosition = newPosition;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user