Opened 10 years ago

Closed 9 years ago

#13798 closed defect (fixed)

[patch] [cla] dojo.Animation produces inconsistent results with duration:0

Reported by: Daniel N. Owned by: Karl Tiedt
Priority: high Milestone: 1.8
Component: fx Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

It's an edge case, but duration: 0 can lead to not applying the final step of an animation. If the current time and the start time in _cycle are identical to the millisecond, step will resolve to NaN instead of Infinity. This can easily be fixed:

if(step >= 1
!isFinite(step)){

step = 1; }

Attachments (2)

DojoFxDurationZero.patch (356 bytes) - added by Thomas Bachem 10 years ago.
dojoFX.patch (509 bytes) - added by Karl Tiedt 10 years ago.
Karl's version of the patch

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by Thomas Bachem

A duration of 0 should always call beforeBegin(), onBegin() and onEnd() as expected. We've patched this bug in our builds for some time now, see attached patch.

Changed 10 years ago by Thomas Bachem

Attachment: DojoFxDurationZero.patch added

comment:2 Changed 10 years ago by Karl Tiedt

I would propose a slightly different patch to this...

http://bugs.dojotoolkit.org/browser/dojo/dojo/trunk/_base/fx.js#L274

should read

var step = _t.duration === 0 ? 1 : (curr - _t._startTime) / (_t.duration);

Changed 10 years ago by Karl Tiedt

Attachment: dojoFX.patch added

Karl's version of the patch

comment:3 Changed 10 years ago by Karl Tiedt

Summary: dojo.Animation produces inconsistent results with duration:0[patch] [cla] dojo.Animation produces inconsistent results with duration:0

comment:4 Changed 9 years ago by Karl Tiedt

Milestone: tbd1.8
Owner: changed from Bryan Forbes to Karl Tiedt
Status: newassigned

comment:5 Changed 9 years ago by Karl Tiedt

Resolution: fixed
Status: assignedclosed

In [28453]:

Fixes #13798 - allow animations of 0 duration to properly call animation callbacks !strict

Note: See TracTickets for help on using tickets.