diff --git a/pantograph/handlers.py b/pantograph/handlers.py index ed1c7c4..cdfa684 100644 --- a/pantograph/handlers.py +++ b/pantograph/handlers.py @@ -116,9 +116,9 @@ def fill_circle(self, x, y, radius, color = "#000", **extra): self.draw("circle", x=x, y=y, radius=radius, fillColor=color, **extra) - def draw_line(self, startX, startY, endX, endY, color = "#000", **extra): + def draw_line(self, startX, startY, endX, endY, color = "#000", width = 1, **extra): self.draw("line", startX=startX, startY=startY, - endX=endX, endY=endY, color=color, **extra) + endX=endX, endY=endY, color=color, width=width, **extra) def fill_polygon(self, points, color = "#000", **extra): self.draw("polygon", points=points, fillColor=color, **extra) diff --git a/pantograph/js/pantograph.js b/pantograph/js/pantograph.js index 327f688..55800e2 100644 --- a/pantograph/js/pantograph.js +++ b/pantograph/js/pantograph.js @@ -112,6 +112,7 @@ pantograph.drawOval = function(ctx, oval) { pantograph.drawLine = function(ctx, line) { ctx.beginPath(); + ctx.lineWidth = line.width; ctx.moveTo(line.startX, line.startY); ctx.lineTo(line.endX, line.endY); ctx.strokeStyle = line.color || "#000";