scratchfoundation / scratch-gui

Graphical User Interface for creating and running Scratch 3.0 projects.
https://scratchfoundation.github.io/scratch-gui/develop/
BSD 3-Clause "New" or "Revised" License
4.42k stars 3.5k forks source link

New sprites are randomly positioned only in top right quadrant #2340

Closed danfarrow closed 6 years ago

danfarrow commented 6 years ago

Expected Behavior

When adding or duplicating sprites they should be positioned randomly on the stage

Actual Behavior

Sprites are only positioned in the top right quadrant of the stage, where X & Y are positive

Steps to Reproduce

Create a bunch of new sprites and notice that they only appear in the top right quadrant of the stage

Operating System and Browser

Windows 10, Firefox 60.0.2, MS Edge 42.17

scratch3-random-sprite-placement

paulkaplan commented 6 years ago

For anyone interested in fixing this, the fix would be in scratch-vm, src/sprites/rendered-target in the duplicate method, changing the newTarget.x/y to use (Math.random() - 0.5) instead of Math.random()

towerofnix commented 6 years ago

@paulkaplan PR incoming!