1
0
Fork 0
freesewing/packages/charlie/src/index.js

25 lines
683 B
JavaScript
Raw Normal View History

2021-01-30 16:30:45 +01:00
import freesewing from '@freesewing/core'
import Titan from '@freesewing/titan'
import plugins from '@freesewing/plugin-bundle'
import config from '../config'
// Parts
import draftBack from './back'
import draftFront from './front'
// Create design
const Pattern = new freesewing.Design(config, plugins)
// Attach titan draft methods to prototype
for (let p of ['Front', 'Back']) {
Pattern.prototype[`draftTitan${p}`] = function(part) {
return new Titan(this.settings)[`draft${p}`](part)
}
}
// Attach charlie draft methods to prototype
Pattern.prototype.draftBack = part => draftBack(part)
Pattern.prototype.draftFront = part => draftFront(part)
export default Pattern