leopard-js / leopard

Library for making Scratch-like projects with JavaScript.
https://leopardjs.com
MIT License
136 stars 26 forks source link

Implement size boundaries based on current costume #202

Open towerofnix opened 1 week ago

towerofnix commented 1 week ago

Leopard currently allows sprites to have any size. Apart from causing rendering bugs (mostly addressed by #199), this means sprites can grow unreasonably gigantic (potentially crashing the browser: https://github.com/leopard-js/leopard/pull/199#issuecomment-2210967921), and the "size" reporter/property certainly doesn't cap at the expected values.

We need to port the code that determines a sprite's effective size limits from Scratch, and assess compatibility: