Closed 2jfw closed 7 months ago
I'm not sure that I understand your proposal.
Let's assume that a Slide
transition's duration is 2 seconds. Here are some scenarios that explain how it should behave with the current behavior when playing in reverse (this._duration * this._position
):
Here's how it would behave with your proposed new behavior when playing in reverse (this._duration * (1 + this._position)
):
Thanks for the input on this - seems I was on the wrong track with the workaround, which actually worked quite well in my scenario to fix the very short resulting duration, but it's obviously wrong. I will probably need to check more in depth regarding the position property. I set the distance (/ratio) to perform the successful drag to a lower value as the default and I will have to check if this is causing the low duration.
I was playing around with the
StackScreenNavigator
and added apopTransition
like= Slide.createSlideRightTransition(.3, Transitions.EASE_OUT);
Scenario: Two screens in the navigator, currently being on the second screen right to the initial screen 1.
Action: Touch-Slide back to the left to go back to screen 1 but not finishing the action so that
handleDragEnd
with_dragCancelled = true
gets called, which is calling_dragEffectContext.playReverse();
.Observation: The effect does not tween back in the given duration but resets kind of immediately due to the low calculated
duration
(var duration:Number = this._duration * this._position;
) which is ~0.0x s.Workaround: Similar to the
play
function's determination ofduration
, adding a "1" like the following:Old/Before:
var duration:Number = this._duration * this._position;
New/After:
var duration:Number = this._duration * (1 + this._position);
will resolve the issue and slide back on cancel tweens as expected. Unsure if this is the correct solution or just a workaround though.
In the case this is an actual issue and the correct way to fix it, I can create a pull request for the fix