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) {
// Adapt length for ribbing
let ribbingHeight
if (typeof store.get('ribbingHeight') === 'undefined') {
ribbingHeight =
(measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight
store.set('ribbingHeight', ribbingHeight)
} else ribbingHeight = store.get('ribbingHeight')
let ribbingHeight =
(measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight
store.setIfUnset('ribbingHeight', ribbingHeight)
points.hem = points.hem.shift(90, ribbingHeight)
if (front) points.cfHem = points.cfHem.shift(90, ribbingHeight)
else points.cbHem = points.cbHem.shift(90, ribbingHeight)

View file

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