Skip to content

Commit

Permalink
feat(pr/fixLineWidth) Fix problem on fabric.Line controls and line.ge…
Browse files Browse the repository at this point in the history
…tWidth()
  • Loading branch information
vudduu committed Feb 24, 2017
1 parent 53c0109 commit 6f2cbdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/mixins/object_geometry.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,8 @@
*/
_getNonTransformedDimensions: function() {
var strokeWidth = this.strokeWidth,
w = this.width,
w = this.width + strokeWidth,
h = this.height + strokeWidth;
if (this.type !== 'line') {
w = w + strokeWidth;
}
return { x: w, y: h };
},

Expand Down
8 changes: 1 addition & 7 deletions src/shapes/line.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,8 @@
if (dim.x === 0) {
dim.y -= this.strokeWidth;
}
if (dim.y === 0) {
dim.x -= this.strokeWidth;
}
}
dim.x = this.width;
return dim;
},

Expand All @@ -247,10 +245,6 @@
x1 = xMult * (this.width - this.strokeWidth) * 0.5;
x2 = xMult * (this.width - this.strokeWidth) * -0.5;
}
else {
x1 = xMult * this.width * 0.5;
x2 = xMult * this.width * -0.5;
}
return {
x1: x1,
x2: x2,
Expand Down

0 comments on commit 6f2cbdc

Please sign in to comment.