-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
[Feature] Different width/height for canvas and canvas style #3198
Comments
I guess that's a fine request. Feel free to create a PR. |
@finetjul But as I have tested, if set size differently like this the image is stretched:
what is the correct way of doing this? |
did you check |
|
You need to use the ResizeObserver to propagate the aspect ratio to the underlying render window. |
Motivation
The canvas logical size, which is different than it's dom size(computed css style size).
I want to have them seperated so that I could set the logical size to the original size of the rendering texture, so that I could get the image data in the original resolution, but still be able to change the canvas dom size to fit the design.
Detailed Description
For now when calling
setSize
on a view, the logical size and the dom size are changed altogether, for example if I want to maintain the original resolution to 512512, I would want to callsetSize(512, 512)
, but then the canvas dom size changed to 512512 too, which is not expected.The text was updated successfully, but these errors were encountered: