bugfix: keep layer effects and live text through size changes and adjustments - #181
Open
naco-siren wants to merge 1 commit into
Open
naco-siren wants to merge 1 commit into
naco-siren wants to merge 1 commit into
Conversation
Canvas Size, Image Size, Crop and Trim rebuilt the document's layers from a snapshot without their effects, live text or live shapes: every layer lost its effects, and text and shape layers became plain pixels. They now build the layers from one shared list, the same one opening a project uses, and Canvas Size (which Crop and Trim go through) carries effects over. Image Size resamples the pixels, so it scales the effects' sizes, distances and blurs with them, as Photoshop's Scale Styles does; it still turns text and shapes into pixels. Hue/Saturation, Levels, Invert and merging a transformed selection back into its layer rebuilt that layer without its effects too. They keep them now, as the brush and the filters already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #180
Canvas Size, Image Size, Crop and Trim rebuilt the document's layers from a snapshot without their effects, live text or live shapes. Hue/Saturation, Levels, Invert and the floating-selection merge rebuilt the layer they change without its effects.
Changes
ProjectSnapshot.documentLayers(EditorSession+Projects.swift) builds them with their pixels, mask, effects and live text or shape. Opening a project (installProject) andapplyDocumentSize(Canvas Size, Image Size, Crop, Trim) both use it, so they can't drift apart again.effectsinto the new manifest. It already carriedshapeandtext.LayerEffects.scaled(by:)). When the image is stretched unevenly it uses the geometric mean of the two factors, and it keeps each value within the rangeisValidaccepts. Text and shapes are still resampled into pixels, as before.effects:when they rebuild the layer, as the brush and filters already do.docs/project-format.mdnow lists which edits keep editable text, and says Image Size scales effects. What's saved doesn't change, so there's no format version bump.Testing
LayerEffectsSurviveTests: 9 tests, one per edit, each going through the same entry point as its menu command. All 9 fail onmainand pass with this change.CompositorTestssuite passes locally: 519 passed, 0 failed.FloatingPanelTestsandSliderSnapTestswere skipped locally; CI runs them on their own.