Skip to content

Commit f7622ba

Browse files
authored
Merge pull request #1989 from VisActor/fix/fix-bug-of-symbol&auto-refresh
Fix/fix bug of symbol&auto refresh
2 parents 9fb0836 + decc1db commit f7622ba

39 files changed

+3189
-4
lines changed

packages/vrender-components/src/label/base.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,8 @@ export class LabelBase<T extends BaseLabelAttrs> extends AnimateComponent<T> {
862862
const relatedGraphic = this.getRelatedGraphic(text.attribute);
863863
const { enter } = this._animationConfig;
864864

865-
[text, labelLine].filter(Boolean).forEach(item =>
865+
[text, labelLine].filter(Boolean).forEach(item => {
866+
item.setFinalAttributes?.(item.attribute);
866867
item.applyAnimationState(
867868
['enter'],
868869
[
@@ -884,8 +885,8 @@ export class LabelBase<T extends BaseLabelAttrs> extends AnimateComponent<T> {
884885
}
885886
}
886887
]
887-
)
888-
);
888+
);
889+
});
889890
}
890891

891892
protected _runUpdateAnimation(prevLabel: LabelContent, currentLabel: LabelContent) {

packages/vrender-core/src/core/stage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ export class Stage extends Group implements IStage {
590590
});
591591
}
592592
enableAutoRefresh() {
593-
if (this.autoRefresh) {
593+
if (this.autoRefresh || this.global.env === 'node') {
594594
return;
595595
}
596596
this.autoRefresh = true;

packages/vrender-core/src/graphic/symbol.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ export class Symbol extends Graphic<ISymbolGraphicAttribute> implements ISymbol
122122
const { size = symbolTheme.size } = attribute;
123123

124124
const symbolClass = this.getParsedPath();
125+
if (!symbolClass) {
126+
return aabbBounds;
127+
}
125128
symbolClass.bounds(size, aabbBounds);
126129

127130
return aabbBounds;
@@ -136,6 +139,9 @@ export class Symbol extends Graphic<ISymbolGraphicAttribute> implements ISymbol
136139

137140
toCustomPath() {
138141
const symbolInstance = this.getParsedPath();
142+
if (!symbolInstance) {
143+
return null;
144+
}
139145
const size = this.attribute.size;
140146
const x = 0;
141147
const y = 0;
27.2 KB
Loading
1.86 KB
Loading
3.28 KB
Loading
17 KB
Loading
3.78 KB
Loading
4.71 KB
Loading
5.79 KB
Loading

0 commit comments

Comments
 (0)