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 79c5d73 commit b8f6f98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 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 @@ -243,7 +241,10 @@
y1 = (yMult * this.height * 0.5),
x2 = (xMult * this.width * -0.5),
y2 = (yMult * this.height * -0.5);

if (this.strokeLineCap === 'round') {
x1 = xMult * (this.width - this.strokeWidth) * 0.5;
x2 = xMult * (this.width - this.strokeWidth) * -0.5;
}
return {
x1: x1,
x2: x2,
Expand Down

0 comments on commit b8f6f98

Please sign in to comment.