2022-01-19 16:23:25 +01:00
|
|
|
const draftCutonfold = (part) => {
|
2022-01-17 18:14:05 +01:00
|
|
|
const { points, Point, paths, Path, options, macro } = part.shorthand()
|
|
|
|
|
2022-01-18 08:30:33 +01:00
|
|
|
if (['cutonfold', 'all'].indexOf(options.plugin) !== -1) {
|
2022-01-19 16:23:25 +01:00
|
|
|
points.a = new Point(0, 0)
|
|
|
|
points.b = new Point(200, 0)
|
2022-01-17 18:14:05 +01:00
|
|
|
macro('cutonfold', {
|
|
|
|
from: points.a,
|
|
|
|
to: points.b,
|
|
|
|
margin: options.cutonfoldMargin,
|
|
|
|
offset: options.cutonfoldOffset,
|
2022-01-19 16:23:25 +01:00
|
|
|
grainline: options.cutonfoldGrainline,
|
2022-01-17 18:14:05 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
// Prevent clipping of text
|
2022-01-19 16:23:25 +01:00
|
|
|
paths.box = new Path().move(new Point(0, -30)).line(new Point(210, 10)).attr('class', 'hidden')
|
2022-01-17 18:14:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return part
|
|
|
|
}
|
|
|
|
|
|
|
|
export default draftCutonfold
|