Conversation
…ds for height and width
addon/motions/resize.js
Outdated
| ).plus(this.prior.widthTween); | ||
|
|
||
| this.heightTween = (toHeight === false) | ||
| ? { done: true } |
There was a problem hiding this comment.
I'll fix this indentation issue alongside any other comments.
addon/motions/resize.js
Outdated
| sprite.finalBounds.height / sprite.finalCumulativeTransform.d, duration | ||
| ); | ||
| this.widthTween = (fromWidth === false || toWidth === false) | ||
| ? { done: true } |
There was a problem hiding this comment.
I think this will break when one resize motion interrupts another, because of this line below:
).plus(this.prior.widthTween);Instead of having a special case here for a missing toWidth or fromWidth, it may be easier to change _extractHeightAndWidthOpts so that if one of those is missing, it substitutes the other. So instead of returning
{
fromWidth: 100,
toWidth: false,
...
}it would become:
fromWidth: 100,
toWidth: 100, // this automatically defaulted to being the same as fromWidthThis will give you a Tween that doesn't actually move, but that's what we want.
ef4
left a comment
There was a problem hiding this comment.
Thanks, this is looking good other than the comment about the interruption case.
For the tests, a good style of test to copy is
ember-animated/tests/integration/components/animated-container-test.js
Lines 411 to 432 in cd153da
You can use the time controls to interrupt a running motion and cause it to start going back the other way, to make sure that case also works.
…c required for cases where sprite starts or ends by not being present in the DOM
|
Sorry about the massive delay in moving this on. |
|
Just checking if this is still not possible in |
A WIP PR to address #113
The issue here is that when wrapping a resize motion in an animated-if transition, the sprite either starts or ends without initialBounds/finalBounds. This PR allows the caller to provide some initial/final height/width values to act in place of calculated bounds.
I'd really appreciate and feedback on the approach here, as it to my eyes it looks a bit clunky. There might be a cleaner way to do this, so I'm definitely open to feedback.
TODO: