Fix line rendering when points make height become negative. Closes #589

This commit is contained in:
kangax 2013-05-21 18:38:32 +02:00
parent f3f1db63b3
commit 8a52f99292
4 changed files with 7 additions and 7 deletions

4
dist/all.js vendored
View file

@ -12038,8 +12038,8 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
_setWidthHeight: function(options) {
options || (options = { });
this.set('width', (this.x2 - this.x1) || 1);
this.set('height', (this.y2 - this.y1) || 1);
this.set('width', Math.abs(this.x2 - this.x1) || 1);
this.set('height', Math.abs(this.y2 - this.y1) || 1);
this.set('left', 'left' in options ? options.left : (this.x1 + this.width / 2));
this.set('top', 'top' in options ? options.top : (this.y1 + this.height / 2));

6
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -56,8 +56,8 @@
_setWidthHeight: function(options) {
options || (options = { });
this.set('width', (this.x2 - this.x1) || 1);
this.set('height', (this.y2 - this.y1) || 1);
this.set('width', Math.abs(this.x2 - this.x1) || 1);
this.set('height', Math.abs(this.y2 - this.y1) || 1);
this.set('left', 'left' in options ? options.left : (this.x1 + this.width / 2));
this.set('top', 'top' in options ? options.top : (this.y1 + this.height / 2));