0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

Merge pull request #315 from codeclown/patch-1

fix issue when render.lineWidth = 0, closes #220
This commit is contained in:
Liam 2017-01-15 15:16:25 +00:00 committed by GitHub
commit 68382d62c3

View file

@ -385,9 +385,11 @@ var Vector = require('../geometry/Vector');
c.lineTo(constraint.pointB.x, constraint.pointB.y); c.lineTo(constraint.pointB.x, constraint.pointB.y);
} }
c.lineWidth = constraint.render.lineWidth; if (constraint.render.lineWidth) {
c.strokeStyle = constraint.render.strokeStyle; c.lineWidth = constraint.render.lineWidth;
c.stroke(); c.strokeStyle = constraint.render.strokeStyle;
c.stroke();
}
} }
}; };
@ -523,15 +525,19 @@ var Vector = require('../geometry/Vector');
if (!options.wireframes) { if (!options.wireframes) {
c.fillStyle = part.render.fillStyle; c.fillStyle = part.render.fillStyle;
c.lineWidth = part.render.lineWidth;
c.strokeStyle = part.render.strokeStyle; if (part.render.lineWidth) {
c.lineWidth = part.render.lineWidth;
c.strokeStyle = part.render.strokeStyle;
c.stroke();
}
c.fill(); c.fill();
} else { } else {
c.lineWidth = 1; c.lineWidth = 1;
c.strokeStyle = '#bbb'; c.strokeStyle = '#bbb';
c.stroke();
} }
c.stroke();
} }
c.globalAlpha = 1; c.globalAlpha = 1;