Skip to content

Extension blocks mess up overall script spacing of imported projects #1761

Open
@towerofnix

Description

@towerofnix

In general, when you open a project, its block layout should be pretty much the same as in 2.0. Since 3.0's blocks are rather larger than 2.0, there is code to multiply the positions so that blocks are still readable and generally don't overlap each other: https://github.com/LLK/scratch-vm/blob/26ced0dd5806b68d47008a4dd44964717e19714c/src/serialization/sb2.js#L40-L44

The problem is that some blocks have a significantly higher 3.0-to-2.0 width ratio than most. The majority of these are extension blocks (and blocks that were reworded, like "wait 1 secs" -> "wait 1 seconds"); this is because extension blocks now have icons to indicate what extension they're from, noticeably increasing total block width. These blocks aren't accounted for in the scale values shown above, which means that projects that use them can end up having their code areas look really, really messy in 3.0.

A recent example case of this is Japan ~ Sketch and Noteblocks (Dear Theodosia). Its scripting area is already very compact in Scratch 2.0:

The 2.0 scripting area, showing many stacks starting "when I receive" hats and including several "play note for N beats" and "rest for N beats" blocks attached, all arranged in a compact grid-like pattern

But in Scratch 3.0, it's nearly impossible to navigate:

The same scripts in 3.0, showing the "play note for N beats" blocks frequently overlapping adjacent scripts

Projects where blocks are so compact are relatively rare, but the fact that extension blocks have significantly greater width than before is worth thinking about anyway.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions