1
0
Fork 0

fix(markdown): Updated Example to v3

This commit is contained in:
Joost De Cock 2022-10-12 00:25:06 +02:00
parent 728449c627
commit d1edf93750
2 changed files with 36 additions and 4 deletions

View file

@ -7,8 +7,25 @@ The coordinate system in FreeSewing -- and in SVG -- follows the same rules as t
You start at the top-left, and as you go to the right, the X-coordinate will increase.
As you go down the Y-coordinate will increase.
<Example part="docs_coords">
The SVG coordinate system
<Example caption="The coordinate system in an SVG document">
```mjs
({ Point, points, paths, Path, part }) => {
points.origin = new Point(10, 10)
points.x = new Point(100, 10)
points.y = new Point(10, 50)
points.textX = new Point(85, 20).addText('X', 'text-lg')
points.textY = new Point(12, 43).addText('Y', 'text-lg')
paths.coords = new Path()
.move(points.y)
.line(points.origin)
.line(points.x)
.addClass('mark')
.attr('marker-start', 'url(#dimensionFrom)')
.attr('marker-end', 'url(#dimensionTo)')
return part
}
```
</Example>
The image above illustrates both the X-axis and Y-axis.