sprotty icon indicating copy to clipboard operation
sprotty copied to clipboard

Allow to include viewport changes into the animations of model updates

Open NiklasRentzCAU opened this issue 6 years ago • 2 comments

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.

NiklasRentzCAU avatar Nov 13 '19 12:11 NiklasRentzCAU

This would also solve #121 and #164.

spoenemann avatar Nov 06 '23 20:11 spoenemann

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.

dhuebner avatar Dec 04 '23 13:12 dhuebner