1
0
Fork 0
freesewing/markdown/dev/reference/api/config/options/pct/en.md
Joost De Cock 249f2600e5 chore: More linting
@nicholasdower is smarter than me. What's missing was the
`listItemIndent` setting
2022-02-20 14:44:38 +01:00

1.8 KiB

title
percentage

Percentage options are the bread and butter of freesewing. Almost all your options will most likely be percentage options as they ensure that your pattern will scale regardless of size.

Structure

Your percentage option should be a plain object with these properties:

Percentage options will be divided by 100 when loaded

You specify percentages in your config file. For example, 50 means 50%. When your configuration is loaded, those percentages will be divided by 100.

So a percentage of 50 in your config file will be 0.5 when you read out that option in your pattern.

Percentage options are not limited to the range 0-100

The minimum and maximum (and default) percentages are not restricted to the range from 0% to 100%. A percentage option that spans from -25% to 135% is just as valid.

Example

Below is a simple example:

options: {
  acrossBackFactor: { 
    pct:  97, 
    min:  93, 
    max: 100 
  }
}

Advanced use

Percentage options have a few more tricks up their sleeve: