Closed KristofferStrube closed 6 months ago
It would likewise be able to animate this fit over a period. For this, we can register a Zoom-Translate state and a time when the transition starts, and then when the editor rerenders in the given period after that, calculate its difference to the start time to get a linear transition to the end Zoom-Translate state. This should, of course, be cancelable, and the period should be configurable. Later we can look into making custom transition modes like EaseIn, EaseOut, EaseInOut, etc.
It would be awesome to be able to call some function on the
SVGEditor
taking a list of shapes that would zoom and translate the viewport of the editor so that the given shapes are centered in the middle of the editor with some padding from the edge of the bounding area.This could be especially useful in the Blazor.GraphEditor library where nodes' positions are updated continuously.