diff --git a/README.md b/README.md index b71eacc..5417c8d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,12 @@ func ExampleNew() { svg.Title(svg.CharData("Example triangle01- simple example of a 'path'")), svg.Desc(svg.CharData("A path that draws a triangle")), svg.Rect().XYWidthHeight(1, 1, 398, 398, svg.Number).Fill("none").Stroke("blue"), - svg.Path().D("M 100 100 L 300 100 L 200 300 z").Fill("red").Stroke("blue").StrokeWidth(svg.Number(3)), + svg.Path().D(svgpath.New( + svgpath.MoveToAbs([]float64{100, 100}), + svgpath.LineToAbs([]float64{300, 100}), + svgpath.LineToAbs([]float64{200, 300}), + svgpath.ClosePath(), + )).Fill("red").Stroke("blue").StrokeWidth(svg.Number(3)), ) if _, err := svgElement.WriteToIndent(os.Stdout, "", " "); err != nil { panic(err) @@ -36,7 +41,7 @@ Output: