Closed txoof closed 8 months ago
This is likely due to how the block properties are set and updated. Ultimately this has something to do with how mutable objects are used in the calculation of the layout.
The problem is most likely in the Layout class and has something to do with values that are pulled from the constants file (which is not technically constant).
Updating the resolution never triggers a recalculation of the layout.
The _calculate_layout
method only looks for blocks that do not have absolute coordinates and calculates them as needed and stores them in the _layout
property. When resetting the resolution, _calculate_layout
ignores all the existing blocks.
This can be solved by creating a new private property _master_layout
and deepcopying the provided layout into this object. This is then treated as immutable and deep copied whenever _calculate_layout
runs again.
This is primarily an issue when developing in jupyter notebook where all the objects remain in memory.
Something odd is going on when a new resolution is set that requires clearing all the objects out of memory before a new resolution can be set.
this is a developer quality-of-life improvement