mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-22 04:11:52 +00:00
Fixed issue with fabric.Line when browser doesn't support 'setLineDash' (firefox & IE 10). Example at http://jsfiddle.net/taRvU/1/
This commit is contained in:
parent
39164c289a
commit
f97d593c84
1 changed files with 5 additions and 2 deletions
|
|
@ -120,8 +120,11 @@
|
|||
* @param {CanvasRenderingContext2D} ctx Context to render on
|
||||
*/
|
||||
_renderDashedStroke: function(ctx) {
|
||||
var x = this.width === 1 ? 0 : -this.width / 2,
|
||||
y = this.height === 1 ? 0 : -this.height / 2;
|
||||
var
|
||||
xMult = this.x1 <= this.x2 ? -1 : 1,
|
||||
yMult = this.y1 <= this.y2 ? -1 : 1,
|
||||
x = this.width === 1 ? 0 : xMult * this.width / 2,
|
||||
y = this.height === 1 ? 0 : yMult * this.height / 2;
|
||||
|
||||
ctx.beginPath();
|
||||
fabric.util.drawDashedLine(ctx, x, y, -x, -y, this.strokeDashArray);
|
||||
|
|
|
|||
Loading…
Reference in a new issue