Skip to content

X and Y positions differ at edge of stage between Scratch 2 and 3 #403

Open
@ktbee

Description

@ktbee

Expected Behavior

When you send a sprite off stage (say X position = 1000 and Y = 0), its position should be limited to the edge of the stage and its X and Y values should be the same in Scratch 2 and 3.

Actual Behavior

The X or Y value that goes off stage is slightly different in Scratch 3 vs. Scratch 2. In Scratch 2, the X and Y values are integers. In Scratch 3, they are floating point numbers that are within about .5 pixels of the Scratch 2 position value.

Steps to Reproduce

I've created an sb2 project as a potential scratch-test that reproduces this issue well. You can find this file below:

sprite-goes-off-stage.sb2.zip

The repro steps:

  • In the Scratch 2 offline editor, send a sprite off stage and use the "say" looks block to display the "x position" motion block or the "y position" motion block.
  • Save the sb2 project and load it in Scratch 3
  • Observe that the X or Y value for when the sprite tries to go off stage (for example go to 1000,0 or to 0,1000) is different than the values for Scratch 2.

Operating System and Browser

Mac OS 10.14 Chrome 71.0.3578.98

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions