From a49b39cd21dbd56c73115c60e83875690740b56d Mon Sep 17 00:00:00 2001 From: Eugene Obrezkov Date: Wed, 29 Jun 2016 12:45:09 +0300 Subject: [PATCH] fix(animation): Fix issue with wrong calculation of duration Since animateProperty has been overriden, I forgot to rewrite duration calcucation based on strings, not the numbers --- src/Print.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Print.js b/src/Print.js index 338480b..967a08f 100644 --- a/src/Print.js +++ b/src/Print.js @@ -41,8 +41,8 @@ export default class Print extends Animation { * @param {Object} options Options object * @param {Object} options.shape Shape where property is need to be animated * @param {String} options.property Property name that need to be animated - * @param {Number} options.startValue Start value for animation - * @param {Number} options.endValue End value for animation + * @param {String} options.startValue Start value for animation + * @param {String} options.endValue End value for animation * @param {Number} [options.byValue] Step value for easing, by default it calculates automatically * @param {Number} [options.duration] Duration of the animation in ms, by default it takes from Animation options * @param {String} [options.easing] Easing that need to apply to animation, by default it takes from Animation options @@ -57,7 +57,7 @@ export default class Print extends Animation { const byValue = options.byValue || (endValue.length - startValue.length); const duration = options.duration || this.getDuration(); const easing = options.easing || this.getEasing(); - const delay = duration / (endValue - startValue); + const delay = duration / (endValue.length - startValue.length); const start = Date.now(); const end = start + duration; const tick = resolve => {