fix: HTML canvas does not match the canvas range after the camera is applied (#1702) #1752
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 This is a ...
🔗 Related issue link
fixed #1702
💡 Background and solution
When the html canvas uses a div element as a container, the camera's transformation will be applied to the div element, so that after the user pans or zooms, the div cannot maintain the same width and height as the canvas element. As a container for rendering html elements, this will cause some problems, such as #1702 .
The solution is to add an additional div element as the html canvas container, whose direct child element is the camera's div element. In this hierarchical structure, the camera's transformation and rendering container are independent and do not affect each other. The html container div will always remain consistent with the canvas element.
📝 Changelog
☑️ Self Check before Merge