Change scratch-svg-renderer width/height argument order
SheepTester opened this issue · 5 comments
I think in general, they should only use the modded packages. This would requiring linking scratch-svg-renderer to scratch-vm as well
Consequence of this: HTMLifier couldn't load Scratch 2.0 projects with bitmap images because the arguments are different
Actually, should probably change the argument order so that the width/height are AFTER the existing arguments, then use null
for the first two. This way it's less likely to break, I think
It's possible that the HTMLifier never worked for 2.0 projects. I guess it's not a big issue then. Currently 2.0 projects with a custom ratio might not work properly, but whatever
Bruh can you, like, link to the relevant lines in the future? Thanks
Bruh can you, like, link to the relevant lines in the future? Thanks
nvm it's in src/playground/vim.js
nvm it's in src/playground/vim.js
that's misspelled smh
There is nothing to change in scratch-vm/src/playground/vm.js
Anyways, the HTMLifier expects the dimensions last:
However, scratch-svg-renderer* still uses dimensions first
This is where scratch-gui* creates an instance of BitmapAdapter:
https://github.com/SheepTester/scratch-gui/blob/16-9/src/lib/file-uploader.js#L147
Issue: https://scratch.mit.edu/discuss/topic/466668/
The project outputs the following error:
Uncaught (in promise) TypeError: Cannot read property 'assetMatchesBase' of undefined
Apparently there's a related issue with vanilla Scratch, but I think this is a modded problem. https://github.com/LLK/scratch-vm/issues/2220
Action:
- Consider temporarily switching argument order to dimension-first in the HTMLifier.
- When the mod is next updated, fix BitmapAdapter's argument order.
- Then, ASAP make HTMLifier's argument order back to dimension-final.