Skip to content

fix(oxvg_optimiser): honour applyTransformsStroked - #294

Merged
noahbald merged 3 commits into
noahbald:mainfrom
happyarts:fix/apply-transforms-stroked
Sep 29, 2026
Merged

noahbald merged 3 commits into
noahbald:mainfrom
happyarts:fix/apply-transforms-stroked

Conversation

@happyarts

Copy link
Copy Markdown
Contributor

Description

The check in apply_stroked is inverted: applyTransformsStroked: false still applies transforms to stroked paths, and true skips them. This negates the check and makes true the default, as in SVGO. The default output stays the same; explicit settings now do what they say, which reverses them for existing configs. Docs and the checked-in .d.ts comments are updated to match.

Motivation and Context

convertSvgoConfig passes SVGO's applyTransformsStroked: true through, which currently turns the feature off.

How Has This Been Tested?

New snapshot test for both settings; all oxvg_optimiser tests pass and existing snapshots are unchanged.

Types of changes

Fixes

  • applyTransforms: honour applyTransformsStroked

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

🤖 Generated with Claude Code

The check in `apply_stroked` was inverted: with `applyTransformsStroked:
false` transforms were still applied to stroked paths, and with `true`
they were skipped. Because the option defaulted to `false`, the default
output happened to match SVGO (whose default is `true`), but any explicit
setting, including SVGO configs converted by `convertSvgoConfig`, did
the opposite of what was asked.

Negate the check and default the option to `true`, as in SVGO, so the
default output is unchanged; explicit settings now do what they say,
which reverses their effect for anyone who set them before. The docs,
including the TypeScript definitions, are updated to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread crates/oxvg_optimiser/src/jobs/apply_transforms.rs Outdated
Comment thread crates/oxvg_optimiser/src/jobs/mod.rs Outdated
happyarts and others added 2 commits September 29, 2026 01:43
…nfig defaults

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahbald
noahbald merged commit 7f2019e into noahbald:main Sep 29, 2026
44 checks passed
@happyarts
happyarts deleted the fix/apply-transforms-stroked branch September 29, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants