1
0
Fork 0
freesewing/packages/rendertest/src/test.js

32 lines
917 B
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import colors from './colors'
import circles from './circles'
import text from './text'
import snippets from './snippets'
import macros from './macros'
2019-05-07 12:50:49 +02:00
2021-01-31 09:22:15 +01:00
export default function (part) {
2019-08-03 15:03:33 +02:00
let { macro, store, options, Path, paths, Point } = part.shorthand()
store.set('y', 0)
store.set('w', options.width)
let color = ['fabric', 'lining', 'interfacing', 'canvas', 'various', 'mark', 'contrast', 'note']
store.set('colors', color)
2019-05-20 16:25:43 +02:00
if (options.widthHd)
2019-08-03 15:03:33 +02:00
macro('hd', {
2019-05-20 16:25:43 +02:00
from: new Point(0, 0),
to: new Point(options.width, 0)
2019-08-03 15:03:33 +02:00
})
if (options.colors) colors(part)
if (options.circles) circles(part)
if (options.text) text(part)
if (options.snippets) snippets(part)
if (options.macros) macros(part)
2019-05-07 12:50:49 +02:00
// Make sure no text is cut off
paths.box = new Path()
.move(new Point(0, -10))
2019-08-03 15:03:33 +02:00
.line(new Point(store.get('w'), store.get('y')))
.attr('class', 'hidden')
2019-05-07 12:50:49 +02:00
2019-08-03 15:03:33 +02:00
return part
2019-05-07 12:50:49 +02:00
}