1
0
Fork 0
freesewing/packages/examples/src/path_close.js

20 lines
494 B
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { box } from './shared'
2019-05-25 11:11:46 +02:00
2021-01-31 09:22:15 +01:00
export default (part) => {
2019-08-03 15:03:33 +02:00
let { Point, points, Path, paths } = part.shorthand()
2019-05-25 11:11:46 +02:00
2019-08-03 15:03:33 +02:00
points.from = new Point(10, 20)
points.cp2 = new Point(60, 30)
points.to = new Point(90, 20)
2019-05-25 11:11:46 +02:00
paths.line = new Path()
.move(points.from)
._curve(points.cp2, points.to)
.close()
.reverse() // To keep text from being upside-down
2019-08-03 15:03:33 +02:00
.attr('data-text', 'Path._close()')
.attr('data-text-class', 'text-sm right fill-note')
2019-05-25 11:11:46 +02:00
2019-08-03 15:03:33 +02:00
return box(part, 100, 25)
}