1
0
Fork 0

fix(carlita): Apply expand to inherited parts

This commit is contained in:
joostdecock 2023-09-16 16:50:17 +02:00
parent c9b2f08c0a
commit 34042bb6ca
2 changed files with 40 additions and 1 deletions

View file

@ -3,7 +3,26 @@ import { frontFacing as carltonFrontFacing } from '@freesewing/carlton'
export const frontFacing = { export const frontFacing = {
name: 'carlita.frontFacing', name: 'carlita.frontFacing',
from: carltonFrontFacing, from: carltonFrontFacing,
draft: ({ points, macro, part }) => { draft: ({ points, macro, expand, store, part }) => {
if (expand) store.flag.preset('expandIsOn')
else {
// Expand is on, do not draw the part but flag this to the user
store.flag.note({
msg: `carlton:cutFrontFacing`,
suggest: {
text: 'flag:show',
icon: 'expand',
update: {
settings: ['expand', 1],
},
},
})
// Also hint about expand
store.flag.preset('expandIsOff')
return part.hide()
}
macro('title', { macro('title', {
at: points.title, at: points.title,
nr: '1c', nr: '1c',

View file

@ -7,10 +7,30 @@ function draftCarlitaFrontLining({
store, store,
points, points,
macro, macro,
expand,
paths, paths,
Path, Path,
part, part,
}) { }) {
if (expand) store.flag.preset('expandIsOn')
else {
// Expand is on, do not draw the part but flag this to the user
store.flag.note({
msg: `carlton:cutFrontLining`,
suggest: {
text: 'flag:show',
icon: 'expand',
update: {
settings: ['expand', 1],
},
},
})
// Also hint about expand
store.flag.preset('expandIsOff')
return part.hide()
}
const collar = paths.frontCollar.split(points.flbTop) const collar = paths.frontCollar.split(points.flbTop)
const armhole = paths.frontArmhole const armhole = paths.frontArmhole