gonfunko / 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
0 stars 1 forks source link

fix: preserve toolbox scroll position when switching between sprites/the stage #10

Closed gonfunko closed 6 months ago

gonfunko commented 6 months ago

This PR preserves the toolbox scroll position when switching between editing targets. This is sort of best effort since the set of available blocks changes when doing this; if the topmost block in the toolbox still exists in the toolbox for the new target, it will appear at the same place at the top of the toolbox; otherwise the relative position within the current category is maintained. This broadly feels like the most correct approach, and seems to generally match what Scratch does. Note that this won't work until https://github.com/google/blockly-samples/pull/2337 is published and we update to that version of the continuous toolbox.