Use set with object in tests (rather than chaining it).

This commit is contained in:
kangax 2011-06-14 10:11:25 -04:00
parent 0a9d835b12
commit 27c72bd634
4 changed files with 15 additions and 13 deletions

5
dist/all.js vendored
View file

@ -5018,8 +5018,6 @@ fabric.util.animate = animate;
if (!allOnTop) {
this.clearContext(containerCanvas);
}
containerCanvas.fillStyle = this.backgroundColor;
containerCanvas.fillRect(0, 0, this.width, this.height);
var length = this._objects.length,
activeGroup = this.getActiveGroup(),
@ -5032,6 +5030,9 @@ fabric.util.animate = animate;
containerCanvas.clip();
}
containerCanvas.fillStyle = this.backgroundColor;
containerCanvas.fillRect(0, 0, this.width, this.height);
if (length) {
for (var i = 0; i < length; ++i) {
if (!activeGroup ||

View file

@ -1195,8 +1195,6 @@
if (!allOnTop) {
this.clearContext(containerCanvas);
}
containerCanvas.fillStyle = this.backgroundColor;
containerCanvas.fillRect(0, 0, this.width, this.height);
var length = this._objects.length,
activeGroup = this.getActiveGroup(),
@ -1209,6 +1207,9 @@
containerCanvas.clip();
}
containerCanvas.fillStyle = this.backgroundColor;
containerCanvas.fillRect(0, 0, this.width, this.height);
if (length) {
for (var i = 0; i < length; ++i) {
if (!activeGroup ||

View file

@ -102,13 +102,13 @@
loadSVGFromURL('../demo/assets/' + shapePath, function(objects, options) {
var pathGroup = new fabric.PathGroup(objects, options);
pathGroup
.set('left', coords[i].x)
.set('top', coords[i].y)
.set('angle', 30)
.set('fill', '#ff5555')
.scale(scaleObjectEl.value)
.setCoords();
pathGroup.set({
left: coords[i].x,
top: coords[i].y,
angle: 30,
fill: '#ff5555'
});
pathGroup.scale(scaleObjectEl.value).setCoords();
canvas.add(pathGroup);

View file

@ -227,7 +227,7 @@
activeGroup = canvas.getActiveGroup();
if (activeObject || activeGroup) {
(activeObject || activeGroup).set('opacity', parseInt(this.value, 10) / 100);
(activeObject || activeGroup).setOpacity(parseInt(this.value, 10) / 100);
canvas.renderAll();
}
};
@ -258,7 +258,7 @@
activeGroup = canvas.getActiveGroup();
if (activeObject || activeGroup) {
(activeObject || activeGroup).set('fill', this.value);
(activeObject || activeGroup).setFill(this.value);
canvas.renderAll();
}
};