Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

fix: improve derivation of style for controller.set #112

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

parkerziegler
Copy link
Contributor

This PR is a small but important one! It improves the way we derive a from style to use for animations set off by controller.set. The algorithm, with this change, becomes:

  • Look at the currently applied style property of the animating element.
  • If there's a matching value for the to property specified in controller.set, use that value. It's very likely this value will have been set by a previous run of a renature animation.
  • If there is not a matching value for the to property specified in controller.set, use the computed value. Computed values are always specified in px, so this is still an edge case where our animations fall a bit short. Would love for community contributors to help out with this piece!

This brings us more in parity with how d3 works, which is our sample reference point for this behind the scenes style derivation.

@parkerziegler parkerziegler merged commit 7de56e2 into saturn Jan 29, 2021
@parkerziegler parkerziegler deleted the fix/improve-style-derivation branch January 29, 2021 18:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants