Skip to content

Commit

Permalink
Уменьшил объём blend
Browse files Browse the repository at this point in the history
  • Loading branch information
ColCh committed Feb 3, 2014
1 parent 0091af9 commit 4878c39
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,11 @@
function blend (from, to, progress, currentValue, roundDigits) {

var valueIsChanged = false;
var previousValue, newValue;
var delta;
for (var i = 0, m = from.length; i < m; i++) {
previousValue = currentValue[i];
delta = to[i] - from[i];

newValue = round( delta * progress + from[i] , roundDigits);

if (previousValue !== newValue) {
currentValue[i] = newValue;
valueIsChanged = true;
}
for (var i = 0, m = from.length; i < m; i++) {
valueIsChanged = currentValue[i] !== (currentValue[i] = round( (to[i] - from[i]) * progress + from[i] , roundDigits)) || valueIsChanged;
}

return valueIsChanged;
}

Expand Down

0 comments on commit 4878c39

Please sign in to comment.