diff options
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/shapes/polyline.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/shapes/polyline.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/public/assets/javascripts/rectangles/engine/shapes/polyline.js b/public/assets/javascripts/rectangles/engine/shapes/polyline.js index 54e11c6..fc6cad7 100644 --- a/public/assets/javascripts/rectangles/engine/shapes/polyline.js +++ b/public/assets/javascripts/rectangles/engine/shapes/polyline.js @@ -95,7 +95,7 @@ var Polyline = Fiber.extend(function(base){ tail: closest_i, } } - exports.draw = function(ctx){ + exports.draw = function(ctx, fillStyle, strokeStyle){ var points = this.points if (! points.length) return if (points.length == 1) { @@ -103,17 +103,17 @@ var Polyline = Fiber.extend(function(base){ map.draw.dot_at(this.points[0].a, points[0].b, 5) } if (points.length > 1) { - ctx.fillStyle = "rgba(255,255,0,0.1)" - ctx.strokeStyle = "#f80" + ctx.fillStyle = fillStyle + ctx.strokeStyle = strokeStyle ctx.lineWidth = 2 / map.zoom ctx.beginPath() ctx.moveTo(points[0].a, points[0].b) points.forEach(function(point, i){ i && ctx.lineTo(point.a, point.b) }) - ctx.stroke() + strokeStyle && ctx.stroke() if (! map.ui.placing || this.closed) { - ctx.fill() + fillStyle && ctx.fill() } } } |
