Commit 328cd9f1 authored by Mike Bostock's avatar Mike Bostock
Browse files

Merge remote-tracking branch 'origin/fix-zero-duration-transitions' into 3.3.6

parents d2ad436f 863f618e
......@@ -7849,7 +7849,7 @@ d3 = function() {
++lock.count;
d3.timer(function(elapsed) {
var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, tweened = [];
if (delay <= elapsed) return start(elapsed);
if (delay <= elapsed) return start(elapsed - delay);
d3_timer_replace(start, delay, time);
function start(elapsed) {
if (lock.active > id) return stop();
......@@ -7860,12 +7860,12 @@ d3 = function() {
tweened.push(value);
}
});
if (tick(elapsed)) return 1;
d3_timer_replace(tick, 0, time);
if (tick(elapsed || 1)) return 1;
d3_timer_replace(tick, delay, time);
}
function tick(elapsed) {
if (lock.active !== id) return stop();
var t = (elapsed - delay) / duration, e = ease(t), n = tweened.length;
var t = elapsed / duration, e = ease(t), n = tweened.length;
while (n > 0) {
tweened[--n].call(node, e);
}
......
This diff is collapsed.
......@@ -69,7 +69,7 @@ function d3_transitionNode(node, i, id, inherit) {
duration = transition.duration,
tweened = [];
if (delay <= elapsed) return start(elapsed);
if (delay <= elapsed) return start(elapsed - delay);
d3_timer_replace(start, delay, time);
function start(elapsed) {
......@@ -83,14 +83,14 @@ function d3_transitionNode(node, i, id, inherit) {
}
});
if (tick(elapsed)) return 1;
d3_timer_replace(tick, 0, time);
if (tick(elapsed || 1)) return 1;
d3_timer_replace(tick, delay, time);
}
function tick(elapsed) {
if (lock.active !== id) return stop();
var t = (elapsed - delay) / duration,
var t = elapsed / duration,
e = ease(t),
n = tweened.length;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment