diff --git a/src/core/animation/ease.js b/src/core/animation/ease.js index f57a07d403..ad731fc189 100644 --- a/src/core/animation/ease.js +++ b/src/core/animation/ease.js @@ -26,6 +26,18 @@ function getEasedValue( type, start, end, percent, easingFn ){ return val; } +function getValue( prop, spec ){ + if( prop.pfValue != null || prop.value != null ){ + if( prop.pfValue != null && (spec == null || spec.type.units !== '%') ){ + return prop.pfValue; + } else { + return prop.value; + } + } else { + return prop; + } +} + function ease( startProp, endProp, percent, easingFn, propSpec ){ let type = propSpec != null ? propSpec.type : null; @@ -35,19 +47,8 @@ function ease( startProp, endProp, percent, easingFn, propSpec ){ percent = 1; } - let start, end; - - if( startProp.pfValue != null || startProp.value != null ){ - start = startProp.pfValue != null ? startProp.pfValue : startProp.value; - } else { - start = startProp; - } - - if( endProp.pfValue != null || endProp.value != null ){ - end = endProp.pfValue != null ? endProp.pfValue : endProp.value; - } else { - end = endProp; - } + let start = getValue( startProp, propSpec ); + let end = getValue( endProp, propSpec ); if( is.number( start ) && is.number( end ) ){ return getEasedValue( type, start, end, percent, easingFn );