Skip to content

Commit

Permalink
refactor: cloneNode copy complete config (#1841)
Browse files Browse the repository at this point in the history
* refactor: cloneNode copy complete config

* test: update test case

* chore: commit changeset
  • Loading branch information
Aarebecca authored Nov 15, 2024
1 parent f3fe467 commit 252427f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-ravens-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/g-lite': patch
---

cloneNode copy complete config
1 change: 1 addition & 0 deletions __tests__/unit/abstract-renderer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('Abstract renderer', () => {
enableCulling: false,
enableDirtyRectangleRendering: true,
enableDirtyRectangleRenderingDebug: false,
enableRenderingOptimization: false,
enableSizeAttenuation: true,
});

Expand Down
5 changes: 1 addition & 4 deletions packages/g-lite/src/display-objects/DisplayObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,7 @@ export class DisplayObject<
const cloned = new (this.constructor as ConstructorTypeOf<DisplayObject>)({
// copy id & name
// @see https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode#notes
id: this.id,
name: this.name,
className: this.name,
interactive: this.interactive,
...this.config,
style: clonedStyle,
});

Expand Down

0 comments on commit 252427f

Please sign in to comment.