Skip to content

Comments

Enhance viewport animation tween function for smooth zoom and scroll#510

Open
NiklasRentzCAU wants to merge 1 commit intomasterfrom
nre/ConsistentViewportAnimation
Open

Enhance viewport animation tween function for smooth zoom and scroll#510
NiklasRentzCAU wants to merge 1 commit intomasterfrom
nre/ConsistentViewportAnimation

Conversation

@NiklasRentzCAU
Copy link
Contributor

The old tween function for viewport animations had an exponential zoom factor curve (expected for a continuous looking zoom), but a linear interpolation for the offset. This caused animations with zoom changes to move the diagram in an unintended curve. This change fixes that behavior and incorporates the exponential zoom into the scroll offset for a consistent zoom+pan animation.

This change makes the zoomFactor field obsolete, it is not used anymore because mathematical simplifications in the formula do not require the log calculation anymore. I did not remove it with this PR because that would be a API-breaking change.

These clips show the old and new behavior during a center and fit to screen command and during an animated zoom operation.

animation-current.mp4
animation-fixed.mp4

The old tween function for viewport animations had an exponential zoom factor curve (expected for a continuous looking zoom), but a linear interpolation for the offset. This caused animations with zoom changes to move the diagram in an unintended curve. This change fixes that behavior and incorporates the exponential zoom into the scroll offset for a consistent zoom+pan animation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant