修改代码

This commit is contained in:
ival 2021-04-12 09:20:11 +08:00
parent 45f9b1d9e2
commit 83a0e74a88
2 changed files with 2 additions and 24 deletions

View File

@ -46,27 +46,18 @@ class AbstractShape extends Group {
this.instance.position = this.model.base.position;
this.instance.rotation = this.model.base.rotation*Math.PI/180;
this.instance.origin = utils.createOrigin(this.instance);
console.log(this.model.base.position, this.model.base.rotation);
this.instance.transform = utils.createTransform({scale: this.model.base.scale, position: this.model.base.position, rotation: this.model.base.rotation*Math.PI/180});
this.setInvisible(this.model.base.hide)
}
// 修改状态
attr(attrs) {
if (this.instance) {
this.instance.attr(attrs);
} else {
super.attr(attrs);
}
this.instance? this.instance.attr(attrs): super.attr(attrs);
}
// 设置显隐
setInvisible(hide) {
if (hide) {
super.hide()
} else {
super.show();
}
hide ? super.hide() : super.show();
super.dirty();
}

View File

@ -1,6 +1,4 @@
import shapeLayer from './constant/shapeLayer';
import * as graphic from './core/graphic';
export default class SelectHandle {
constructor(map, controller) {
this.$map = map;
@ -50,17 +48,6 @@ export default class SelectHandle {
});
}
// createSelected(target) {
// if (this.$map.draggle) {
// switch (target.type) {
// case graphic.Line:
// return new LineDraggable(this);
// case graphic.Image:
// return new ImageDraggable(this);
// }
// }
// }
setDraggable(draggable) {
const target = this.e.target;
if (target &&