1
0
Fork 0

chore(sven): Avoided laoding unset ribbingHeight from store

This commit is contained in:
Joost De Cock 2020-07-19 09:45:17 +02:00
parent d20be35f94
commit 53e8274624
2 changed files with 8 additions and 13 deletions

View file

@ -21,12 +21,9 @@ export default (part) => {
if (options.ribbing) { if (options.ribbing) {
// Adapt length for ribbing // Adapt length for ribbing
let ribbingHeight let ribbingHeight =
if (typeof store.get('ribbingHeight') === 'undefined') { (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight
ribbingHeight = store.setIfUnset('ribbingHeight', ribbingHeight)
(measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight
store.set('ribbingHeight', ribbingHeight)
} else ribbingHeight = store.get('ribbingHeight')
points.hem = points.hem.shift(90, ribbingHeight) points.hem = points.hem.shift(90, ribbingHeight)
if (front) points.cfHem = points.cfHem.shift(90, ribbingHeight) if (front) points.cfHem = points.cfHem.shift(90, ribbingHeight)
else points.cbHem = points.cbHem.shift(90, ribbingHeight) else points.cbHem = points.cbHem.shift(90, ribbingHeight)

View file

@ -13,13 +13,11 @@ export const draftRibbing = function (part, length) {
macro, macro,
units units
} = part.shorthand() } = part.shorthand()
if (typeof store.get('ribbingHeight') === 'undefined' || part.context.settings.sample) {
store.set( let height = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight
'ribbingHeight', if (part.context.settings.sample) store.set('ribbingHeight', height)
(measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight else store.setIfUnset('ribbingHeight', height)
)
}
let height = store.get('ribbingHeight')
let gap = 25 let gap = 25
let lead = 50 let lead = 50
if (length < 125) lead = length / 3 if (length < 125) lead = length / 3