mirror of
https://gitee.com/antv/g6.git
synced 2024-12-04 12:49:04 +08:00
fix: zoom-canvas with optimizeZoom, drag-canvas shows the node shapes hiden by zoom-canvas optimizeZoom, closes: #2996;
This commit is contained in:
parent
c85470832b
commit
a3bbe03a79
@ -5,6 +5,7 @@
|
||||
- fix: when select a node with click-select, selected combos should be deselected;
|
||||
- fix: contextmenu with click trigger does not show the menu up, closes: #2982;
|
||||
- fix: layout with collapsed combo, closes: #2988;
|
||||
- fix: zoom-canvas with optimizeZoom, drag-canvas shows the node shapes hiden by zoom-canvas optimizeZoom, closes: #2996;
|
||||
|
||||
#### 4.3.3
|
||||
|
||||
|
@ -202,6 +202,11 @@ export default {
|
||||
|
||||
if (this.keydown) return;
|
||||
|
||||
const currentZoom = graph.getZoom();
|
||||
const modeController = graph.get('modeController');
|
||||
const zoomCanvas = modeController?.modes[modeController.mode]?.filter(behavior => behavior.type === 'zoom-canvas')?.[0];
|
||||
const optimizeZoom = zoomCanvas ? zoomCanvas.optimizeZoom || 0.1 : 0;
|
||||
|
||||
if (this.enableOptimize) {
|
||||
// 拖动结束后显示所有的边
|
||||
const edges = graph.getEdges();
|
||||
@ -213,15 +218,17 @@ export default {
|
||||
if (oriVis) shape.show();
|
||||
});
|
||||
}
|
||||
const nodes = graph.getNodes();
|
||||
for (let j = 0, nodeLen = nodes.length; j < nodeLen; j++) {
|
||||
const container = nodes[j].getContainer();
|
||||
const children = container.get('children');
|
||||
for (const child of children) {
|
||||
const isKeyShape = child.get('isKeyShape');
|
||||
if (!isKeyShape) {
|
||||
const oriVis = child.get('ori-visibility');
|
||||
if (oriVis) child.show();
|
||||
if (currentZoom > optimizeZoom) {
|
||||
const nodes = graph.getNodes();
|
||||
for (let j = 0, nodeLen = nodes.length; j < nodeLen; j++) {
|
||||
const container = nodes[j].getContainer();
|
||||
const children = container.get('children');
|
||||
for (const child of children) {
|
||||
const isKeyShape = child.get('isKeyShape');
|
||||
if (!isKeyShape) {
|
||||
const oriVis = child.get('ori-visibility');
|
||||
if (oriVis) child.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user