mirror of
https://gitee.com/antv/g6.git
synced 2024-11-29 18:28:19 +08:00
fix(behaviors): fix optimize viewport transform does not hide edge arrow (#6217)
Co-authored-by: antv <antv@antfin.com>
This commit is contained in:
parent
e8f7a05702
commit
7cb9d269e0
@ -20,6 +20,7 @@ export const behaviorOptimizeViewportTransform: TestCase = async (context) => {
|
||||
style: {
|
||||
labelFontSize: 8,
|
||||
labelText: (datum) => datum.id,
|
||||
startArrow: true,
|
||||
},
|
||||
},
|
||||
behaviors: ['drag-canvas', 'zoom-canvas', 'scroll-canvas', 'optimize-viewport-transform'],
|
||||
|
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 115 KiB |
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 108 KiB |
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 114 KiB |
@ -59,22 +59,16 @@ export class OptimizeViewportTransform extends BaseBehavior<OptimizeViewportTran
|
||||
this.bindEvents();
|
||||
}
|
||||
|
||||
private filterShapes = (shapes: DisplayObject[], classnames?: string[]) => {
|
||||
return shapes.filter((shape) => shape.className && !classnames?.includes(shape.className));
|
||||
};
|
||||
|
||||
private setElementsVisibility = (
|
||||
elements: DisplayObject[],
|
||||
visibility: BaseStyleProps['visibility'],
|
||||
excludedClassnames?: string[],
|
||||
) => {
|
||||
elements.forEach((element) => {
|
||||
setVisibility(
|
||||
element,
|
||||
visibility,
|
||||
false,
|
||||
(shape) => !!shape.className && !excludedClassnames?.includes(shape.className),
|
||||
);
|
||||
setVisibility(element, visibility, false, (shape) => {
|
||||
if (!shape.className) return true;
|
||||
return !excludedClassnames?.includes(shape.className);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user