google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.4k stars 3.7k forks source link

initial position of blocks on the workspace #175

Closed msprotz closed 9 years ago

msprotz commented 9 years ago

Hi there,

This issue is about the initial placement of blocks when loading an exiting blockly program.

Since programs usually grow towards the right and towards the bottom, it may make more sense to position the viewport at the topmost, leftmost zone of the workspace, then the blocks themselves in the top left corner of that viewport.

Hope that's clear.

Jonathan

NeilFraser commented 9 years ago

A scrolling workspace with just one block in it should be large enough to allow the block to scroll anywhere on the visible screen (but not beyond). This means that if a block is in the top-left corner, then there must be one screenfull of workspace off-screen above the block, and one screenful of workspace off-screen to the left of the block. This means that the scrollbars will be at the right-most and bottom-most positions. Placing the first block at the top-left of the workspace (not necessarily the screen) would cause Blockly to expand the workspace so that there is new space to the left and above the block (as we do now) so that the workspace is scrollable.

The original version of App Inventor featured an infinitely growing workspace. However, it only grew down and to the right. We got a lot of feedback from users about how frustrating it was to add something at the top of a program. Every group of blocks needed to be dragged down to make room. When we created Blockly we solved this issue by allowing the workspace to grow in all four directions. But this does naturally result in off-screen space above and to the left of the first block, with scrollbars starting at the bottom-right limits.

msprotz commented 9 years ago

That makes sense, thanks!