mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 11:48:29 +08:00
improve code
This commit is contained in:
parent
cacebdf633
commit
92ff7c1134
@ -128,6 +128,5 @@ G6.registerBehaviour('wheelZoom', graph => {
|
||||
timeout = setTimeout(() => {
|
||||
timeout = undefined;
|
||||
}, 50);
|
||||
graph.emit('afterzoom');
|
||||
}
|
||||
});
|
||||
|
@ -106,12 +106,16 @@ Mixin.AUGMENT = {
|
||||
* @return {Graph} this
|
||||
*/
|
||||
updateMatrix(matrix) {
|
||||
const originMatrix = this.getMatrix();
|
||||
const ev = {
|
||||
updateMatrix: matrix,
|
||||
originMatrix: this.getMatrix()
|
||||
originMatrix
|
||||
};
|
||||
const zoomBool = originMatrix[0] !== matrix[0];
|
||||
this.emit('beforeviewportchange', ev);
|
||||
zoomBool && this.emit('beforezoom', ev);
|
||||
this.setMatrix(matrix);
|
||||
zoomBool && this.emit('afterzoom', ev);
|
||||
this.emit('afterviewportchange', ev);
|
||||
this.draw();
|
||||
return this;
|
||||
|
@ -66,10 +66,6 @@ Shape.registerNode('common', {
|
||||
}
|
||||
return group.addShape('text', {
|
||||
class: 'label',
|
||||
freezePoint: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
attrs
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user