修改代码
This commit is contained in:
parent
80ef1f9ee3
commit
a1a2b1d21e
@ -46,6 +46,7 @@ class Jmap {
|
||||
|
||||
this.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {})); // 缩放
|
||||
this.$painter = new Painter(this);
|
||||
this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()});
|
||||
this.$painter.updateTransform(this.$options);
|
||||
|
||||
this.optionsHandler = this.setOptions.bind(this);
|
||||
|
@ -17,7 +17,7 @@ class Painter {
|
||||
this.initPainterLevels();
|
||||
|
||||
// 视图控制器
|
||||
this.$transformHandle = new TransformHandle(this, this.$zr);
|
||||
this.$transformHandle = new TransformHandle(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,15 +21,13 @@ function createBoundingRect(view) {
|
||||
}
|
||||
|
||||
class TransformHandle {
|
||||
constructor(painter, zr) {
|
||||
constructor(painter) {
|
||||
this.$painter = painter;
|
||||
this.$zr = zr;
|
||||
|
||||
this.parentLevel = this.$painter.getParentLevel();
|
||||
|
||||
console.log(this.parentLevel, 1111);
|
||||
this.rect = { x: 0, y: 0, width: 0, height: 0 };
|
||||
|
||||
this.rect = { x: 0, y: 0, width: this.$zr.getWidth(), height: this.$zr.getHeight() };
|
||||
this.transform = createTransform({ scaleRate: 1, offsetX: 0, offsetY: 0 });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user