ocadotechnology / rapid-router

A Blockly and python based educational game aimed at students age 5-14.
https://www.codeforlife.education
Other
56 stars 62 forks source link

Level Editor layout is wonky #1543

Closed faucomte97 closed 1 month ago

faucomte97 commented 7 months ago

Describe the bug The Level Editor layout has become wonky. The grid has grown in size so it no longer fits in the window and the bin has moved closer to the centre of the window. Additionally, when moving scenery assets onto the grid, the mouse cursor isn't in line with the grid and where the asset actually ends up - most likely a byproduct of the grid being oversized.

This is a side-effect of #1516. Reverting the code to what it was before that change "fixes" it, although the original issue comes back whereby the grid is cut off. A solution needs to be found to fix both problems.

To Reproduce Steps to reproduce the behaviour:

  1. Go to the level editor.
  2. Notice that the grid no longer fits in the window and the bin isn't in the bottom-right corner anymore.
  3. Click on the "Scenery" tab on the side.
  4. Click on any scenery asset.
  5. Drag the asset from the corner of the grid to any point of the grid and notice that where your cursor is doesn't match where the asset ends up.

Expected behaviour The grid should fit within the window and the bin should go back to the bottom-right of the window. Assets that are added to the map should be in line with where the cursor is.

Screenshots Screenshot from 2023-11-28 13-59-37

Desktop (please complete the following information): Probably all (double-check)

SKairinos commented 1 month ago

Can't drag objects into bin when bin is below grid Private Zenhub Video

SKairinos commented 1 month ago

I propose the following fix, we should be able to drag elements off the grid and release it into the bin. However, if the element is released off the grid and it's not over the bin, the element should be placed at max x if it's x coordinate is over the max and max y if it's y coordinate is over the max

lauracumming commented 1 month ago
lauracumming commented 1 month ago