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

refactor: html node support dx, dy #6237

Merged
merged 2 commits into from
Aug 27, 2024
Merged

refactor: html node support dx, dy #6237

merged 2 commits into from
Aug 27, 2024

Conversation

Aarebecca
Copy link
Contributor

In default, the origin position of the html node is the top left. Now the origin position can be offset by dx and dy. Add a demo of html node.

const [width, height] = this.getSize(attributes);
return { ...style, width, height };
return { x: dx, y: dy, ...style, width, height };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

html 原子组件本身也有 xy 属性吧,所以应该传入的 x += dx 吧?

Copy link
Contributor Author

@Aarebecca Aarebecca Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key shape 的位置是相对于副容器的,他没有单独的位置,因此 x 都是 0,所以这里不需要 x += dx

@Aarebecca Aarebecca merged commit c9ba7fc into v5 Aug 27, 2024
5 checks passed
@Aarebecca Aarebecca deleted the refactor/element-html branch August 27, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants