Swapped stroke-width and stroke-color params, fixes #82

This commit is contained in:
Devine Lu Linvega
2019-07-28 06:15:49 +09:00
parent adec70791e
commit 38ee25ac2c
15 changed files with 24 additions and 24 deletions

View File

@@ -223,7 +223,7 @@ function Commander (ronin) {
(fill
(svg align:x align:y "M15,15 L15,15 L285,15 L285,285 L15,285 Z") "#fff")
(stroke
(svg align:x align:y "M60,60 L195,60 A45,45 0 0,1 240,105 A45,45 0 0,1 195,150 L60,150 M195,150 A45,45 0 0,1 240,195 L240,240 ") 5 "#000")`
(svg align:x align:y "M60,60 L195,60 A45,45 0 0,1 240,105 A45,45 0 0,1 195,150 L60,150 M195,150 A45,45 0 0,1 240,195 L240,240 ") "#000" 5)`
String.prototype.insert = function (s, i) { return [this.slice(0, i), `${s}`, this.slice(i)].join('') }
}

View File

@@ -90,8 +90,8 @@ function Library (ronin) {
// Actions
this.stroke = (shape = this.frame(), thickness, color) => { // Strokes a shape.
ronin.surface.stroke(shape, thickness, color)
this.stroke = (shape, color, thickness = 2) => { // Strokes a shape.
ronin.surface.stroke(shape, color, thickness)
return shape
}

View File

@@ -25,7 +25,7 @@ function Surface (ronin) {
// Shape
this.stroke = (shape, width, color, context = this.context) => {
this.stroke = (shape, color, width, context = this.context) => {
context.beginPath()
this.trace(shape, context)
context.lineWidth = width