material-motion / material-motion-swift

A toolkit for building responsive motion using Core Animation.
Apache License 2.0
1.42k stars 79 forks source link

Writes to position won't propagate to positionX or positionY #45

Open jverkoey opened 7 years ago

jverkoey commented 7 years ago

This is because each of these is a distinct property instance. This can be confusing to the end user. The "hack" fix is to always use the same property and apply constraints on it instead, e.g. position.x() and position.y().

Ideally the positionX and positionY properties would react to changes to position.

Note that changes to positionX and positionY do propagate to position because they use externalWrite to adjust the position property.

Resolving this would probably be a matter of having property do an external write to positionX and positionY, so long as this didn't cause a retain cycle.