-
Notifications
You must be signed in to change notification settings - Fork 203
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
The bounding box information obtained by the canvas element and the html element is inconsistent #1743
Labels
Comments
wang1212
added a commit
that referenced
this issue
Aug 5, 2024
Subtract the camera's transformation from the bounding box calculation logic of the `HTML` element to keep the result consistent with the native canvas element
14 tasks
wang1212
added a commit
that referenced
this issue
Aug 5, 2024
wang1212
added a commit
that referenced
this issue
Aug 5, 2024
Merged
wang1212
added a commit
that referenced
this issue
Aug 5, 2024
* fix: `HTML` element bounding box calculation logic #1743 (#1744) Subtract the camera's transformation from the bounding box calculation logic of the `HTML` element to keep the result consistent with the native canvas element. * Version Packages (#1745) * chore(release): bump version * chore: update g-lite changelog --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: wang1212 <mrwang1212@126.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
wang1212
added a commit
that referenced
this issue
Aug 29, 2024
wang1212
added a commit
that referenced
this issue
Aug 29, 2024
14 tasks
wang1212
added a commit
that referenced
this issue
Aug 30, 2024
Merged
wang1212
added a commit
that referenced
this issue
Aug 30, 2024
* chore: add preview demo npm script * fix: `path` elements are drawn incorrectly (#1761) * fix: `path` elements are drawn incorrectly after using `markerStartOffset` (#1760) * chore: revert package.json * fix: html element's `getBounds` logic exception (#1743) (#1764) * Version Packages (#1762) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a canvas element and an html element and make them completely overlap:
Measure the bounding box information in three situations:
and compare them.
As shown in the figure above, the bounding box information of the html element will change, while that of the canvas element (circle) will not change.
The inconsistency between the canvas element and the html element behavior results in some incorrect visual effects when the two are used together, such as antvis/G6#5781
getBBox()
getBoundingClientRect()
The text was updated successfully, but these errors were encountered: