mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-30 10:04:42 +00:00
Debounce element parsing. Thanks @biovisualize. Closes #1052
This commit is contained in:
parent
dbbd4b2fa7
commit
dbd9193703
6 changed files with 24 additions and 10 deletions
6
dist/fabric.js
vendored
6
dist/fabric.js
vendored
|
|
@ -3421,7 +3421,11 @@ fabric.ElementsParser = {
|
|||
|
||||
createObjects: function() {
|
||||
for (var i = 0, len = this.elements.length; i < len; i++) {
|
||||
this.createObject(this.elements[i], i);
|
||||
(function(_this, i) {
|
||||
setTimeout(function() {
|
||||
_this.createObject(_this.elements[i], i);
|
||||
}, 0);
|
||||
})(this, i);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
14
dist/fabric.min.js
vendored
14
dist/fabric.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/fabric.min.js.gz
vendored
BIN
dist/fabric.min.js.gz
vendored
Binary file not shown.
6
dist/fabric.require.js
vendored
6
dist/fabric.require.js
vendored
|
|
@ -3421,7 +3421,11 @@ fabric.ElementsParser = {
|
|||
|
||||
createObjects: function() {
|
||||
for (var i = 0, len = this.elements.length; i < len; i++) {
|
||||
this.createObject(this.elements[i], i);
|
||||
(function(_this, i) {
|
||||
setTimeout(function() {
|
||||
_this.createObject(_this.elements[i], i);
|
||||
}, 0);
|
||||
})(this, i);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@ fabric.ElementsParser = {
|
|||
|
||||
createObjects: function() {
|
||||
for (var i = 0, len = this.elements.length; i < len; i++) {
|
||||
this.createObject(this.elements[i], i);
|
||||
(function(_this, i) {
|
||||
setTimeout(function() {
|
||||
_this.createObject(_this.elements[i], i);
|
||||
}, 0);
|
||||
})(this, i);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -476,6 +476,8 @@
|
|||
asyncTest('fabric.util.groupSVGElements', function() {
|
||||
ok(typeof fabric.util.groupSVGElements == 'function');
|
||||
|
||||
stop();
|
||||
|
||||
var group1, group2;
|
||||
fabric.loadSVGFromString(SVG_WITH_1_ELEMENT, function(objects, options) {
|
||||
group1 = fabric.util.groupSVGElements(objects, options);
|
||||
|
|
|
|||
Loading…
Reference in a new issue