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.46k stars 3.55k forks source link

Sprite following mouse pointer not working #4648

Open techwonder21 opened 5 years ago

techwonder21 commented 5 years ago

Expected behavior Art7

Actual Behavior https://scratch.mit.edu/projects/25023233/editor/ When sprite is clicked, the clone does not follow the mouse-pointer. ArtArchitecture

Steps to Reproduce

  1. Open project: https://scratch.mit.edu/projects/25023233/editor/
  2. Click the flag
  3. Click any shape and move to a place on the stage
  4. Notice that the shape does not follow the mouse-pointer.

Operating System and Browser: macOS (Mojave) Chrome 72

techwonder21 commented 5 years ago

@ChampikaF @rschamp @thisandagain @tdgreen13

towerofnix commented 5 years ago

The trouble is that the "when this sprite clicked" script is creating the clone as soon as the mouse is pressed down - so the "when I start as a clone, repeat until mouse down?" script stops right away, because the mouse is still pressed during the tick when the clone is created.

The solution here is to make the "when this sprite clicked" block only evaluate once the mouse is lifted up (i.e. a full click has happened), but it's not quite so simple, since that'd break scripts like "when this sprite clicked, repeat until not mouse down: go to mouse-pointer". I know there's been some discussion on this issue before, in different issues/PRs.

(Note the intended drag behavior is somewhat unusual here - click, then release the mouse - this is when the clone is meant to be created - then move the mouse to the wanted position, and click again to release the clone and make a pen stamp.)

thisandagain commented 5 years ago

@kchadha @ktbee @paulkaplan Let's discuss.