Skip to content

Commit

Permalink
Merge pull request #698 from VisActor/perf/background
Browse files Browse the repository at this point in the history
perf: not setAttribute while background is not url, closed #696
  • Loading branch information
xile611 authored Nov 20, 2023
2 parents c770a8a + ac09b4a commit 8e111c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "perf: not setAttribute while background is not url, closed #696",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
3 changes: 2 additions & 1 deletion packages/vrender-core/src/core/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ export class Stage extends Group implements IStage {
this.ticker.addTimeline(this.timeline);
this.timeline.pause();
this.optmize(params.optimize);
if (this._background && isString(this._background)) {
// 如果背景是图片,触发加载图片操作
if (params.background && isString(this._background) && this._background.includes('/')) {
this.setAttributes({ background: this._background });
}
}
Expand Down

0 comments on commit 8e111c4

Please sign in to comment.