-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add OffscreenCanvas support for extractThumbnailBlob #511
Conversation
// store the current resolution | ||
renderer.getSize(_v2A); | ||
const prevWidth = _v2A.x; | ||
const prevHeight = _v2A.y; | ||
|
||
// overwrite the resolution | ||
renderer.setSize(size, size); | ||
renderer.setSize(size, size, !(canvas instanceof OffscreenCanvas)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I didn't know the third argument of setSize is true
by default.
There is no reason resizing the style in this function, could you set false here instead? I also want to change revert to previous resolution
one of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean all renderer.setSize()
in this method do not need to updateStyle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
I've never used offscreen canvas before but let me try this in this opportunity... |
It worked perfectly! |
uhhhh I just have noticed that the resize applies to the screen buffer for several frames since |
Anyway it looks excellent for me, thanks again! merging |
fixes #508