diff --git a/HEADER.js b/HEADER.js index 8ad01b58..b2410e53 100644 --- a/HEADER.js +++ b/HEADER.js @@ -1,6 +1,6 @@ /*! Fabric.js Copyright 2008-2011, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */ -var fabric = fabric || { version: "0.6.7" }; +var fabric = fabric || { version: "0.6.8" }; if (typeof exports != 'undefined') { exports.fabric = fabric; diff --git a/dist/all.js b/dist/all.js index 89bad04b..78228925 100644 --- a/dist/all.js +++ b/dist/all.js @@ -1,6 +1,6 @@ /*! Fabric.js Copyright 2008-2011, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */ -var fabric = fabric || { version: "0.6.7" }; +var fabric = fabric || { version: "0.6.8" }; if (typeof exports != 'undefined') { exports.fabric = fabric; @@ -1846,17 +1846,14 @@ fabric.Observable = { abort = options.abort || function() { return false; }, easing = options.easing || function(pos) { return (-Math.cos(pos * Math.PI) / 2) + 0.5; }, startValue = 'startValue' in options ? options.startValue : 0, - endValue = 'endValue' in options ? options.endValue : 100, - isReversed = startValue > endValue; + endValue = 'endValue' in options ? options.endValue : 100; options.onStart && options.onStart(); var interval = setInterval(function() { time = +new Date(); pos = time > finish ? 1 : (time - start) / duration; - onChange(isReversed - ? (startValue - (startValue - endValue) * easing(pos)) - : (startValue + (endValue - startValue) * easing(pos))); + onChange(startValue + (endValue - startValue) * easing(pos)); if (time > finish || abort()) { clearInterval(interval); options.onComplete && options.onComplete(); @@ -1874,6 +1871,7 @@ fabric.Observable = { fabric.util.animate = animate; })(); + (function() { var slice = Array.prototype.slice; @@ -10659,6 +10657,12 @@ fabric.util.object.extend(fabric.Canvas.prototype, { * @param {Function} callback Callback is invoked when all filters have been applied and new image is generated */ applyFilters: function(callback) { + + if (this.filters.length === 0) { + this.setElement(this._originalImage); + callback && callback(); + return; + } var isLikelyNode = typeof Buffer !== 'undefined' && typeof window === 'undefined', imgEl = this._originalImage, diff --git a/package.json b/package.json index a3a5e7cc..918921f2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fabric", "description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.", - "version": "0.6.7", + "version": "0.6.8", "author": "Juriy Zaytsev ", "keywords": ["canvas", "graphic", "graphics", "SVG", "node-canvas", "parser", "HTML5", "object model"], "repository": "git://github.com/kangax/fabric.js", diff --git a/site b/site index 642a7a2b..62125d16 160000 --- a/site +++ b/site @@ -1 +1 @@ -Subproject commit 642a7a2bc0d939724c06c1b77a0ee12eee7bb63f +Subproject commit 62125d164e36c0effee33afca6fd9e83bbb7d5c8 diff --git a/src/image.class.js b/src/image.class.js index bff3b9c4..26deaa93 100644 --- a/src/image.class.js +++ b/src/image.class.js @@ -240,6 +240,12 @@ * @param {Function} callback Callback is invoked when all filters have been applied and new image is generated */ applyFilters: function(callback) { + + if (this.filters.length === 0) { + this.setElement(this._originalImage); + callback && callback(); + return; + } var isLikelyNode = typeof Buffer !== 'undefined' && typeof window === 'undefined', imgEl = this._originalImage,