diff --git a/src/Tween.js b/src/Tween.js index d85d25ab..ce80724e 100644 --- a/src/Tween.js +++ b/src/Tween.js @@ -167,7 +167,7 @@ * @param {Integer} t time in seconds between 0 and the duration */ seek: function(t) { - this.node = node; + var node = this.node; this._iterate(function(tween) { tween.seek(t * 1000); }); @@ -189,7 +189,7 @@ * @memberof Kinetic.Tween.prototype */ finish: function() { - this.node = node; + var node = this.node; this._iterate(function(tween) { tween.finish(); }); diff --git a/src/Util.js b/src/Util.js index dbf39441..54135c0f 100644 --- a/src/Util.js +++ b/src/Util.js @@ -231,6 +231,7 @@ PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', + EMPTY_STRING = '', ZERO = '0', KINETIC_WARNING = 'Kinetic warning: ', RGB_PAREN = 'rgb(', @@ -536,6 +537,7 @@ return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); }, _hexToRgb: function(hex) { + hex = hex.replace(HASH, EMPTY_STRING); var bigint = parseInt(hex, 16); return { r: (bigint >> 16) & 255,