SheepTester/scratch-gui

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:

https://github.com/SheepTester/htmlifier/blob/616d30c839c74ca8605e7e987c2e197d4c79a391/template.html#L517

However, scratch-svg-renderer* still uses dimensions first

https://github.com/SheepTester/scratch-svg-renderer/blob/55a151688a7a6c98d5a0c51b816c337908620c3d/src/bitmap-adapter.js#L11

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:

  1. Consider temporarily switching argument order to dimension-first in the HTMLifier.
  2. When the mod is next updated, fix BitmapAdapter's argument order.
  3. Then, ASAP make HTMLifier's argument order back to dimension-final.