Skip to content

Commit

Permalink
Merge branch 'master' of github.com:uxebu/bonsai into shape-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
padolsey committed Jul 23, 2012
2 parents 6dd6192 + 542f5c7 commit 9c03a36
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG
@@ -1,4 +1,8 @@
v0.2.1 / 2012-07-12
v0.2.2
-------------------


v0.2.1 / 2012-07-20
-------------------

* Aligned callback usage to use node-style single-callbacks. See https://github.com/uxebu/bonsai/pull/1
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -3,10 +3,10 @@
"name": "bonsai",
"description": "Bonsai runtime and node server",
"main": "src/bootstrapper/_dev/node.js",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"homepage": "https://github.com/uxebu/bonsai/",
"maintainers" : [],
"maintainers": [],
"repository": {
"type": "git",
"url": "git@github.com:uxebu/bonsai.git"
Expand Down
9 changes: 6 additions & 3 deletions src/runner/animation/animation.js
Expand Up @@ -495,7 +495,7 @@ define([
fromValues,
key,
to,
attrStrategy = strategy === 'attr',
isAttrStrategy,
hasTranslations = !!this.translations.length,
easingFunc = this.easing,
endValues = this.properties,
Expand All @@ -514,8 +514,10 @@ define([
fromValues = subjects[s].values;
subject = subjects[s].subject;
strategy = subjects[s].strategy;
isAttrStrategy = strategy === 'attr'

var subjectAttributes = subject._attributes;
var subjectMutatedAttributes = subject._mutatedAttributes;

// loop through all properties and calculate the value
for (var p = 0; p < pl; ++p) {
Expand All @@ -524,15 +526,16 @@ define([
from = fromValues[key];
to = endValues[key];

if (!hasTranslations && attrStrategy) {
if (!hasTranslations && isAttrStrategy) {
// Optimal method (no translations):
subjectAttributes[key] = from + (to - from) * progress;
subjectMutatedAttributes[key] = true;
} else {
values[key] = from + (to - from) * progress;
}
}

if (!hasTranslations && attrStrategy) {
if (!hasTranslations && isAttrStrategy) {
// We've already set them the optimal way. Continue:
subject.markUpdate();
continue;
Expand Down
4 changes: 2 additions & 2 deletions src/runner/animation/keyframe_animation.js
Expand Up @@ -456,8 +456,8 @@ define([
key = keys[i];
frame =
key == +key ? key : // numerical comparision: frame number
key == 'from' ? 0 : // 'from' keyword --> 0
key == 'to' ? duration :
/^(?:from|start)$/.test(key) ? 0 : // 'from' keyword --> 0
/^(?:to|end)$/.test(key) ? duration :
/^\d+%$/.test(key) ? duration * parseFloat(key) / 100 :
clock.toFrameNumber(key); // everything else
keyframesClean[frame] = keyframes[key];
Expand Down

0 comments on commit 9c03a36

Please sign in to comment.