1
0
Fork 0

fix(cathrin): Fixed the handling of the panels option

This includes a fix for https://github.com/freesewing/freesewing.org/issues/619
as well as a fix for the panels option being numbers rather than
strings which causes issues in the DraftConfigurator component
This commit is contained in:
Joost De Cock 2020-05-24 18:44:33 +02:00
parent 56ac6954be
commit ce9b1111aa
4 changed files with 40 additions and 47 deletions

View file

@ -1,56 +1,49 @@
import { version } from "../package.json"; import { version } from '../package.json'
export default { export default {
name: "cathrin", name: 'cathrin',
version, version,
design: ["Cathrin Åhlén", "Joost De Cock"], design: ['Cathrin Åhlén', 'Joost De Cock'],
code: "Joost De Cock", code: 'Joost De Cock',
department: "womenswear", department: 'womenswear',
type: "pattern", type: 'pattern',
difficulty: 4, difficulty: 4,
tags: ["underwear", "top"], tags: ['underwear', 'top'],
optionGroups: { optionGroups: {
fit: ["waistReduction", "panels"], fit: ['waistReduction', 'panels'],
style: [ style: ['backOpening', 'backRise', 'backDrop', 'frontRise', 'frontDrop', 'hipRise']
"backOpening",
"backRise",
"backDrop",
"frontRise",
"frontDrop",
"hipRise"
]
}, },
measurements: [ measurements: [
"underbust", 'underbust',
"naturalWaist", 'naturalWaist',
"hipsCircumference", 'hipsCircumference',
"naturalWaistToUnderbust", 'naturalWaistToUnderbust',
"naturalWaistToHip" 'naturalWaistToHip'
], ],
dependencies: { dependencies: {
panel1: "panels", panel1: 'panels',
panel2: "panels", panel2: 'panels',
panel3: "panels", panel3: 'panels',
panel4: "panels", panel4: 'panels',
panel5: "panels", panel5: 'panels',
panel6: "panels", panel6: 'panels',
panels: "base" panels: 'base'
}, },
inject: { inject: {
panel1: "panels", panel1: 'panels',
panel2: "panels", panel2: 'panels',
panel3: "panels", panel3: 'panels',
panel4: "panels", panel4: 'panels',
panel5: "panels", panel5: 'panels',
panel6: "panels", panel6: 'panels',
panels: "base" panels: 'base'
}, },
hide: ["panels", "base"], hide: ['panels', 'base'],
options: { options: {
// Lists // Lists
panels: { panels: {
list: [11, 13], list: ['11', '13'],
dflt: 13 dflt: '13'
}, },
// Percentages // Percentages
@ -62,4 +55,4 @@ export default {
frontDrop: { pct: 5, min: 0, max: 10 }, frontDrop: { pct: 5, min: 0, max: 10 },
hipRise: { pct: 5, min: 0, max: 15 } hipRise: { pct: 5, min: 0, max: 15 }
} }
}; }

View file

@ -2,7 +2,7 @@ export default function(part) {
let { measurements, options, store, points, paths, Point, Path, utils, debug } = part.shorthand() let { measurements, options, store, points, paths, Point, Path, utils, debug } = part.shorthand()
// Where to divide our corset into panels // Where to divide our corset into panels
if (options.panels === 11) store.set('gaps', [0.15, 0.275, 0.4, 0.6, 0.75]) if (options.panels === '11') store.set('gaps', [0.15, 0.275, 0.4, 0.6, 0.75])
else store.set('gaps', [0.2, 0.35, 0.5, 0.65, 0.8]) else store.set('gaps', [0.2, 0.35, 0.5, 0.65, 0.8])
// Absolute values for some options // Absolute values for some options

View file

@ -1,7 +1,7 @@
import draftPanel1ab from './panel1ab' import draftPanel1ab from './panel1ab'
export default function (part) { export default function (part) {
let { macro, sa, paths, options, complete, paperless } = part.shorthand() let { macro, sa, paths, points, options, complete, paperless } = part.shorthand()
delete paths.outline delete paths.outline
delete paths.panel2 delete paths.panel2
@ -10,7 +10,7 @@ export default function(part) {
delete paths.panel5 delete paths.panel5
delete paths.panel6 delete paths.panel6
if (options.panels === 13) return draftPanel1ab(part) if (options.panels === '13') return draftPanel1ab(part)
// Complete pattern? // Complete pattern?
if (complete) { if (complete) {

View file

@ -86,7 +86,7 @@ export default function(part) {
.move(points.bottomCF) .move(points.bottomCF)
.curve(points.bottomCFCp2, points.hipRiseCp1, points.hipRise) .curve(points.bottomCFCp2, points.hipRiseCp1, points.hipRise)
.split(points.hipsGap2)[1] .split(points.hipsGap2)[1]
if (options.panels === 11) panel3 = panel3.split(points.hipsGap3)[0] if (options.panels === '11') panel3 = panel3.split(points.hipsGap3)[0]
paths.panel3 = panel3 paths.panel3 = panel3
.curve(points.hipsGap3Cp, points.waistGap3LeftCp1, points.waistGap3Left) .curve(points.hipsGap3Cp, points.waistGap3LeftCp1, points.waistGap3Left)
.curve(points.waistGap3LeftCp2, points.underbustGap3LeftCp, points.underbustGap3Left) .curve(points.waistGap3LeftCp2, points.underbustGap3LeftCp, points.underbustGap3Left)
@ -106,7 +106,7 @@ export default function(part) {
.curve(points.hipsGap4Cp, points.waistGap4LeftCp1, points.waistGap4Left) .curve(points.hipsGap4Cp, points.waistGap4LeftCp1, points.waistGap4Left)
.curve(points.waistGap4LeftCp2, points.underbustGap4LeftCp, points.underbustGap4Left) .curve(points.waistGap4LeftCp2, points.underbustGap4LeftCp, points.underbustGap4Left)
.join(topBack.split(points.underbustGap4Left)[1]) .join(topBack.split(points.underbustGap4Left)[1])
if (options.panels === 11) paths.panel4.line(points.underbustGap3Right) if (options.panels === '11') paths.panel4.line(points.underbustGap3Right)
paths.panel4 paths.panel4
.curve(points.underbustGap3RightCp, points.waistGap3RightCp1, points.waistGap3Right) .curve(points.underbustGap3RightCp, points.waistGap3RightCp1, points.waistGap3Right)
.curve(points.waistGap3RightCp2, points.hipsGap3Cp, points.hipsGap3) .curve(points.waistGap3RightCp2, points.hipsGap3Cp, points.hipsGap3)