sprotty
sprotty copied to clipboard
Allow to include viewport changes into the animations of model updates
As far as I can tell, animations done during an UpdateModel are something very different from viewport animations such as the center- or the fit to screen animations and are not interoperable. I suggest that you can send a viewport change as an option in the update model action, whose animation is then merged with the animation of the updated model. This will allow interaction with the diagram that causes a model update via a new layout or something similar to also cause the model to be fit to the screen again as it is wanted in #121 in the same animation. It also allows to define and include some new viewport animation that causes some selected element to stay at the same position on screen although it has a new position in the updated model.
This would also solve #121 and #164.
It also allows to define and include some new viewport animation that causes some selected element to stay at the same position on screen although it has a new position in the updated model.
This part is implemented in the "Random graph" example using TrackSelectedUpdateModelCommand.
For fit or center to screen we can provide a more complex implementation that allows this by adding an additional ViewAnimation taking the newRoot boundaries into account.