when editing a sprites image, using blocks from the images tab
ex:

if, the image that is being edited has a width, or height, of less than 0, then the emulator will crash, and you will be given a “page unresponsive” prompt. even after reloading the page, or exiting to the home page and going back, the emulator takes a while to fix itself.
here is a project showcasing the crash. press A to crash the emulator.
im just posting this in hopes of it being fixed. its not a big issue but it is an issue regardless
1 Like
Nice find! @Richard I’m guessing this is an issue with the C++ code instead of the javaScript? Theoretically it should be calling target_panic(PANIC_INVALID_IMAGE)
when the negative numbers are input for the create image function. For some reason it isn’t, and it must be returning NULL? Idk. Either way, this is really funny imo, and thanks for making a post about it!
3 Likes
good catch! created a PR to fix it: https://github.com/microsoft/pxt-common-packages/pull/1547
@WoofWoof yes and no, we don’t actually run the C++ code in the browser. instead, we have browser implementations that mock out all of the C++ code. this error was in one of those fake C++ implementations
1 Like