Skip to content

Commit

Permalink
rename some methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoji Chen committed Sep 19, 2019
1 parent 57db8f9 commit 385a7d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
7 changes: 4 additions & 3 deletions modules/core/src/lib/attribute-transition-manager.js
Expand Up @@ -64,7 +64,8 @@ export default class AttributeTransitionManager {

// Returns `true` if attribute is transition-enabled
hasAttribute(attributeName) {
return attributeName in this.transitions;
const transition = this.transitions[attributeName];
return transition && transition.inProgress;
}

// Get all the animated attributes
Expand All @@ -73,8 +74,8 @@ export default class AttributeTransitionManager {

for (const attributeName in this.transitions) {
const transition = this.transitions[attributeName];
if (transition.isTransitioning()) {
animatedAttributes[attributeName] = transition.getAttribute();
if (transition.inProgress) {
animatedAttributes[attributeName] = transition.attributeInTransition;
}
}

Expand Down
6 changes: 1 addition & 5 deletions modules/core/src/transitions/gpu-interpolation-transition.js
Expand Up @@ -37,14 +37,10 @@ export default class GPUInterpolationTransition {
];
}

isTransitioning() {
get inProgress() {
return this.transition.inProgress;
}

getAttribute() {
return this.isTransitioning() ? this.attributeInTransition : this.attribute;
}

// this is called when an attribute's values have changed and
// we need to start animating towards the new values
// this also correctly resizes / pads the transform's buffers
Expand Down
6 changes: 1 addition & 5 deletions modules/core/src/transitions/gpu-spring-transition.js
Expand Up @@ -41,14 +41,10 @@ export default class GPUSpringTransition {
];
}

isTransitioning() {
get inProgress() {
return this.transition.inProgress;
}

getAttribute() {
return this.isTransitioning() ? this.attributeInTransition : this.attribute;
}

// this is called when an attribute's values have changed and
// we need to start animating towards the new values
// this also correctly resizes / pads the transform's buffers
Expand Down

0 comments on commit 385a7d9

Please sign in to comment.