1
0
Fork 0

feat(wahid): Add support for high-bust draft. See #2386

This commit is contained in:
Joost De Cock 2022-07-09 17:57:07 +02:00
parent f7fbf8b446
commit ed5639cd04
3 changed files with 21 additions and 5 deletions

View file

@ -258,7 +258,7 @@ utils:
wahid:
peer:
'@freesewing/brian': *freesewing
'@freesewing/plugin-round': *freesewing
'@freesewing/plugin-bust': *freesewing
yuri:
peer:
'@freesewing/brian': *freesewing

View file

@ -18,6 +18,7 @@ export default {
'backScyeDart',
'frontScyeDart',
'centerBackDart',
'draftForHighBust',
],
style: [
'pocketLocation',
@ -42,6 +43,7 @@ export default {
'shoulderToShoulder',
'waist',
],
optionalMeasurements: [ 'highBust' ],
dependencies: {
backBlock: 'base',
frontBlock: 'backBlock',
@ -106,5 +108,8 @@ export default {
shoulderInset: { pct: 10, min: 0, max: 20 },
neckInset: { pct: 5, min: 0, max: 10 },
pocketAngle: { deg: 5, min: 0, max: 5 },
// draft for high bust
draftForHighBust: { bool: false },
},
}

View file

@ -1,8 +1,7 @@
import freesewing from '@freesewing/core'
import Brian from '@freesewing/brian'
import plugins from '@freesewing/plugin-bundle'
import round from '@freesewing/plugin-round'
import buttons from '@freesewing/plugin-buttons'
import plugin from '@freesewing/plugin-bust' // Note: conditional plugin
import config from '../config'
// Parts
import draftFront from './front'
@ -27,8 +26,20 @@ const wristPlugin = {
},
}
// Create pattern
const Wahid = new freesewing.Design(config, [plugins, round, buttons, wristPlugin])
/* Check to see whether we should load the bust plugin
* Only of the `draftForHighBust` options is set
* AND the highBust measurement is available
*/
const condition = (settings = false) =>
settings &&
settings.options &&
settings.options.draftForHighBust &&
settings.measurements.highBust
? true
: false
// Create design
const Wahid = new freesewing.Design(config, [plugins, wristPlugin], { plugin, condition })
// Parts we're getting from Brian
Wahid.prototype.draftBase = function (part) {