Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[g] 自定义图形 cloneNode 有误 #1095

Closed
xiaoiver opened this issue Jul 20, 2022 · 0 comments
Closed

[g] 自定义图形 cloneNode 有误 #1095

xiaoiver opened this issue Jul 20, 2022 · 0 comments
Assignees
Labels

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Jul 20, 2022

克隆箭头这样的自定义组件时,由于 attributes 中含有非 string number 类型这样的值,例如 startHead,body 为基础图形,在拷贝时不能简单使用 Object.assign()

const cloned = new (this.constructor as ConstructorTypeOf<DisplayObject>)({
  id: this.id,
  name: this.name,
  className: this.name,
  interactive: this.interactive,
  style: { ...this.attributes }, // wrong
});
@xiaoiver xiaoiver self-assigned this Jul 20, 2022
@xiaoiver xiaoiver added the bug label Jul 20, 2022
xiaoiver added a commit that referenced this issue Jul 25, 2022
…1105)

* fix: account for special attribute when cloning custom element #1095

* fix: update [email protected] to use latest WGSL syntax #1103

* fix: use elementsFromPoint for picking droppable element  #1094

* fix: use a temporary vec3 when calling setPosition to prevent alloc vec3 too often

Co-authored-by: yuqi.pyq <[email protected]>
@xiaoiver xiaoiver closed this as completed Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant