Repository navigation
fix(presets): keep crop when preset intensity is set to 0 - #1948
Merged
CyberTimon merged 1 commit intoOct 18, 2026
Merged
Conversation
At 0% mixAdjustments returned the whole INITIAL_ADJUSTMENTS object, which reset crop, rotation, masks and every other non-preset setting. Only reset the keys the preset actually contains. Fixes CyberTimon#1941 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
The presets that save the crop will keep the current behavior, though it makes no sense to reset the crop when the preset saves none and amound slider is 0. |
Owner
|
LGTM, thanks for the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1941. Dragging a preset's intensity slider down to 0 reset the crop, along with every other setting the preset doesn't touch (rotation, flips, masks...).
mixAdjustmentshad a shortcut for 0%: it returned the wholeINITIAL_ADJUSTMENTSobject, andhandleIntensityChangespreads that over the current adjustments. Presets leave out geometry and masks by default, so those keys should never be touched by the slider. Every other intensity only mixes the preset's own keys, so only 0% did this.Now 0% goes through the same per-key loop and sets each preset key back to its initial value. Everything outside the preset stays as it is.
Type of Change
Changes Made
PresetsPanel.tsx/mixAdjustments: removed thefraction === 0early return. At 0% each preset key gets its initial value inside the existing loop.Testing
Repro from the issue: apply a preset, crop, drag the preset slider to 0. The crop now stays.
Test Configuration:
Checklist
Additional Notes
#1792 (multi-preset toggle) deletes the same line. It also rebuilds the adjustments from a snapshot taken when the preset was first applied, though, so a crop made after applying the preset may still get reverted there. Whichever PR merges second will need a small rebase.
AI Disclaimer:
Please state the involvement of AI in this PR:
🤖 Generated with Claude Code