1
0
Fork 0

lint fixes

This commit is contained in:
Enoch Riese 2023-04-15 14:51:12 -04:00
parent 5c80c8dbc3
commit ecfe9984ac
2 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,7 @@ import { pluginCutlist } from '@freesewing/plugin-cutlist'
import { cutLayoutPlugin } from '../layout/cut/plugin-cut-layout.mjs' import { cutLayoutPlugin } from '../layout/cut/plugin-cut-layout.mjs'
import { fabricSettingsOrDefault } from '../layout/cut/index.mjs' import { fabricSettingsOrDefault } from '../layout/cut/index.mjs'
import { useFabricLength } from '../layout/cut/settings.mjs' import { useFabricLength } from '../layout/cut/settings.mjs'
import { capitalize, formatFraction128, formatMm } from 'shared/utils.mjs' import { capitalize, formatMm } from 'shared/utils.mjs'
import get from 'lodash.get' import get from 'lodash.get'
export const exportTypes = { export const exportTypes = {

View file

@ -60,7 +60,7 @@ export const cutLayoutPlugin = function (material, grainAngle) {
pattern.addPart({ pattern.addPart({
name: dupPartName, name: dupPartName,
from: activePartConfig, from: activePartConfig,
draft: ({ part, macro, store, points, utils }) => { draft: ({ part, macro, utils }) => {
part.attributes.remove('transform') part.attributes.remove('transform')
// if they shouldn't be identical, flip every other piece // if they shouldn't be identical, flip every other piece
@ -115,10 +115,10 @@ export const cutLayoutPlugin = function (material, grainAngle) {
} }
// if there's a grain angle, rotate the part to be along it // if there's a grain angle, rotate the part to be along it
macro('rotateToGrain', { bias: instruction.bias, flipped, grainSpec }) macro('rotateToGrain', { bias: instruction.bias, grainSpec })
}, },
// mirror the part across the line indicated by cutonfold // mirror the part across the line indicated by cutonfold
mirrorOnFold: ({ fold }, { paths, snippets, utils, macro, points }) => { mirrorOnFold: ({ fold }, { paths, snippets, macro }) => {
// get all the paths to mirror // get all the paths to mirror
const mirrorPaths = [] const mirrorPaths = []
for (const p in paths) { for (const p in paths) {
@ -171,7 +171,7 @@ export const cutLayoutPlugin = function (material, grainAngle) {
* if the part should be on the bias, this rotates the part to lie on the bias * if the part should be on the bias, this rotates the part to lie on the bias
* while keeping the grainline annotation along the grain * while keeping the grainline annotation along the grain
*/ */
rotateToGrain: ({ bias, flipped, grainSpec }, { part, paths, points }) => { rotateToGrain: ({ bias, grainSpec }, { part, paths, points, Point }) => {
// the amount to rotate is the difference between this part's grain angle (as drafted) and the fabric's grain angle // the amount to rotate is the difference between this part's grain angle (as drafted) and the fabric's grain angle
let toRotate = grainSpec === undefined ? 0 : grainAngle + grainSpec let toRotate = grainSpec === undefined ? 0 : grainAngle + grainSpec
// don't over rotate // don't over rotate