diff --git a/README.md b/README.md index 72789e2..aa2a1cb 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ If you installed luamin, you can use the script `minify.bat` included to minify - strokeWidth: string => lines width, default to 1 - fill: string => fill color, default to svg:create() parameter ("transparent" by default) -**svg:Line(points, stroke, strokeWidth, fill)** *add a polyline* +**svg:Polyline(points, stroke, strokeWidth, fill)** *add a polyline* - points: string => all the points of the polyline with the standard svg format "x1,y1 x2,y2 x3,y3 ..." - stroke: string => lines color diff --git a/svg.lua b/svg.lua index 71e416c..4a60b5c 100644 --- a/svg.lua +++ b/svg.lua @@ -168,7 +168,7 @@ end -- stroke: string => lines color -- strokeWidth: string => lines width -- fill: string => fill color -function svg:Line(points, stroke, strokeWidth, fill) +function svg:Polyline(points, stroke, strokeWidth, fill) return self.Element:create("line", { points = points or "10,10 50,50 50,25 75,25", stroke = stroke or self.stroke, diff --git a/test.lua b/test.lua index 4238fab..376edad 100644 --- a/test.lua +++ b/test.lua @@ -12,4 +12,5 @@ mon_dessin:add(mon_dessin:Rect()) mon_dessin:add(mon_dessin:Circle()) mon_dessin:add(mon_dessin:Ellipse()) mon_dessin:add(mon_dessin:Line()) +mon_dessin:add(mon_dessin:Polyline()) print(mon_dessin:draw()) \ No newline at end of file