From df2b856e8f6e660d308bed0a8caf7e4d39eaca4a Mon Sep 17 00:00:00 2001 From: Thrunic Date: Sun, 12 Nov 2023 13:27:28 -0500 Subject: [PATCH] Adds support for 'expand' for crotchGusset. --- designs/onyx/i18n/en.json | 1 + designs/onyx/src/crotchgusset.mjs | 3 +++ designs/onyx/src/front.mjs | 16 ++++++++++++++++ designs/onyx/src/raglansleeve.mjs | 4 ---- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/designs/onyx/i18n/en.json b/designs/onyx/i18n/en.json index fb8b76ecf47..274855a6222 100644 --- a/designs/onyx/i18n/en.json +++ b/designs/onyx/i18n/en.json @@ -20,6 +20,7 @@ "cutOneSkirt": "Cut one rectangle of fabric\nfor the skirt, with dimensions:", "cutTwoSleeveRibbing": "Cut two rectangles of ribbing\nfor the wrists, with dimensions:", "cutTwoLegRibbing": "Cut two rectangles of ribbing\nfor the legs, with dimensions:", + "cutOneCrotchGusset": "Cut one rectangle of main fabric\nfor the crotch gusset, with dimensions:", "cutNeckband": "Cut one rectangle of\nribbing or main fabric\nfor the neckband, with dimensions:" }, "o": { diff --git a/designs/onyx/src/crotchgusset.mjs b/designs/onyx/src/crotchgusset.mjs index e37cd0c4d0d..9f7bba23cf4 100644 --- a/designs/onyx/src/crotchgusset.mjs +++ b/designs/onyx/src/crotchgusset.mjs @@ -11,11 +11,14 @@ function draftCrotchGusset({ part, store, sa, + expand, macro, snippets, Snippet, scale, }) { + if (!expand) return part.hide() + const crotchGussetLength = store.get('crotchGussetLength') const crotchGussetWidth = store.get('crotchGussetWidth') diff --git a/designs/onyx/src/front.mjs b/designs/onyx/src/front.mjs index 12e4be6b5c7..22aa79a3d9e 100644 --- a/designs/onyx/src/front.mjs +++ b/designs/onyx/src/front.mjs @@ -178,6 +178,22 @@ function draftFront({ ) } + const crotchGussetLength = store.get('crotchGussetLength') + const crotchGussetWidth = store.get('crotchGussetWidth') + points.crotchGussetInstructions = points.legRibbingInstructions + if (complete && !expand) { + points.crotchGussetInstructions = points.crotchGussetInstructions + .translate(0, 50) + .attr('data-text', 'onyx:cutOneCrotchGusset') + .attr('data-text', ':\n') + .attr( + 'data-text', + `${units(2 * sa + store.get('crotchGussetWidth'))} x ${units( + sa + (options.legRibbing ? sa : absoluteOptions.legHem) + store.get('crotchGussetLength') + )}` + ) + } + const neckPath = new Path() .move(points.neckShoulderCorner) .curve(points.neckCp1, points.neckCp2, points.cfNeck) diff --git a/designs/onyx/src/raglansleeve.mjs b/designs/onyx/src/raglansleeve.mjs index 497f8af54e2..ec4f374f80c 100644 --- a/designs/onyx/src/raglansleeve.mjs +++ b/designs/onyx/src/raglansleeve.mjs @@ -316,10 +316,6 @@ function draftRaglanSleeve({ } points.neckbandInstructions = points.sleeveRibbingInstructions - const neckbandLength = - (store.get('neckLengthFront') + store.get('neckLengthBack') + store.get('neckLengthSide')) * - options.neckbandLength - const neckbandWidth = 2 * absoluteOptions.neckbandWidth if (complete && !expand && options.legRibbing) { points.neckbandInstructions = points.neckbandInstructions .translate(0, 50)