Merge pull request #7125 from freesewing/7121-bug-octoplushy-design-crashes-if-changing-armlength-option-and-others
Fix issue #7121 and two more bugs
This commit is contained in:
commit
0e7de8585c
2 changed files with 12 additions and 27 deletions
|
@ -28,9 +28,9 @@ function octoplushyArmSection(
|
||||||
const sections = options.type == 'squid' ? 10 : 8
|
const sections = options.type == 'squid' ? 10 : 8
|
||||||
|
|
||||||
const sectionWidth = (w * 2) / sections
|
const sectionWidth = (w * 2) / sections
|
||||||
const armWidth = w * options.armWidth * (1 - options.bottomTopArmRatio) * 3.1415
|
const armWidth = w * options.armWidth * (1 - options.bottomTopArmRatio) * Math.PI
|
||||||
const armAdjustedWidth = armWidth * (1 - options.bottomTopArmRatio)
|
const armAdjustedWidth = armWidth * (1 - options.bottomTopArmRatio)
|
||||||
let armLength = ((w * 2) / 3.1415) * options.armLength
|
let armLength = ((w * 2) / Math.PI) * options.armLength
|
||||||
switch (options.type) {
|
switch (options.type) {
|
||||||
case 'octopus':
|
case 'octopus':
|
||||||
armLength *= 2
|
armLength *= 2
|
||||||
|
|
|
@ -28,9 +28,9 @@ function octoplushyHeadSection(
|
||||||
|
|
||||||
const sectionWidth = (w * 2) / sections
|
const sectionWidth = (w * 2) / sections
|
||||||
const neckWidth = sectionWidth * options.neckWidth
|
const neckWidth = sectionWidth * options.neckWidth
|
||||||
const armWidth = w * options.armWidth * options.bottomTopArmRatio * 3.1415
|
const armWidth = w * options.armWidth * options.bottomTopArmRatio * Math.PI
|
||||||
const armAdjustedWidth = armWidth * options.bottomTopArmRatio
|
const armAdjustedWidth = armWidth * options.bottomTopArmRatio
|
||||||
let armLength = ((w * 2) / 3.1415) * options.armLength
|
let armLength = ((w * 2) / Math.PI) * options.armLength
|
||||||
if (options.type == 'octopus') {
|
if (options.type == 'octopus') {
|
||||||
armLength *= 2
|
armLength *= 2
|
||||||
}
|
}
|
||||||
|
@ -613,15 +613,9 @@ const options = {
|
||||||
min: 5,
|
min: 5,
|
||||||
max: 500,
|
max: 500,
|
||||||
menu: 'style',
|
menu: 'style',
|
||||||
toAbs: (val, { options }, mergedOptions) =>
|
toAbs: (val, _, mergedOptions) =>
|
||||||
((mergedOptions.sizeConstant * val * 2) / 3.1415) *
|
((mergedOptions.sizeConstant * val * 2) / Math.PI) *
|
||||||
(options.type === undefined
|
(mergedOptions.type === 'octopus' ? 1.7 : mergedOptions.type === 'squid' ? 2 : 1),
|
||||||
? 1
|
|
||||||
: options.type == 'octopus'
|
|
||||||
? 1.7
|
|
||||||
: options.type == 'squid'
|
|
||||||
? 2
|
|
||||||
: 1),
|
|
||||||
},
|
},
|
||||||
type: { dflt: 'octoplushy', list: ['octoplushy', 'octopus', 'squid'], menu: 'style' },
|
type: { dflt: 'octoplushy', list: ['octoplushy', 'octopus', 'squid'], menu: 'style' },
|
||||||
armWidth: { pct: 15, min: 10, max: 30, menu: 'style' },
|
armWidth: { pct: 15, min: 10, max: 30, menu: 'style' },
|
||||||
|
@ -630,19 +624,10 @@ const options = {
|
||||||
min: 100,
|
min: 100,
|
||||||
max: 500,
|
max: 500,
|
||||||
menu: 'style',
|
menu: 'style',
|
||||||
toAbs: (val, { options }, mergedOptions) =>
|
toAbs: (val, _, mergedOptions) =>
|
||||||
((mergedOptions.sizeConstant *
|
((mergedOptions.sizeConstant * mergedOptions.size * 2) / Math.PI) *
|
||||||
(options.size === undefined ? mergedOptions.size : options.size) *
|
|
||||||
2) /
|
|
||||||
3.1415) *
|
|
||||||
val *
|
val *
|
||||||
(options.type === undefined
|
(mergedOptions.type === 'octopus' ? 2 : mergedOptions.type === 'squid' ? 1.8 : 1),
|
||||||
? 1
|
|
||||||
: options.type == 'octopus'
|
|
||||||
? 2
|
|
||||||
: options.type == 'squid'
|
|
||||||
? 1.8
|
|
||||||
: 1),
|
|
||||||
},
|
},
|
||||||
neckWidth: { pct: 25, min: 25, max: 45, menu: 'style' },
|
neckWidth: { pct: 25, min: 25, max: 45, menu: 'style' },
|
||||||
armTaper: { pct: 25, min: 0, max: 50, menu: 'style' },
|
armTaper: { pct: 25, min: 0, max: 50, menu: 'style' },
|
||||||
|
@ -652,14 +637,14 @@ const options = {
|
||||||
min: 75,
|
min: 75,
|
||||||
max: 125,
|
max: 125,
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
menu: (settings, mergedOptions) => (mergedOptions?.type === 'octoplushy' ? 'style' : false),
|
menu: (settings, mergedOptions) => (mergedOptions?.type !== 'octoplushy' ? 'style' : false),
|
||||||
},
|
},
|
||||||
bottomArmReductionPlushy: {
|
bottomArmReductionPlushy: {
|
||||||
pct: 80,
|
pct: 80,
|
||||||
min: 75,
|
min: 75,
|
||||||
max: 125,
|
max: 125,
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
menu: (settings, mergedOptions) => (mergedOptions?.type !== 'octoplushy' ? 'style' : false),
|
menu: (settings, mergedOptions) => (mergedOptions?.type === 'octoplushy' ? 'style' : false),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue