Skip to content

bugfix: keep layer effects and live text through size changes and adjustments - #181

Open
naco-siren wants to merge 1 commit into
robbietilton:mainfrom
naco-siren:fix-lost-layer-effects
Open

naco-siren wants to merge 1 commit into
robbietilton:mainfrom
naco-siren:fix-lost-layer-effects

Conversation

@naco-siren

@naco-siren naco-siren commented Sep 30, 2026 •

Copy link
Copy Markdown

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

  • One way to build layers from a snapshot. A new ProjectSnapshot.documentLayers (EditorSession+Projects.swift) builds them with their pixels, mask, effects and live text or shape. Opening a project (installProject) and applyDocumentSize (Canvas Size, Image Size, Crop, Trim) both use it, so they can't drift apart again.
  • Canvas Size, which Crop and Trim go through, now carries each layer's effects into the new manifest. It already carried shape and text.
  • Image Size keeps effects and scales their sizes, distances and blurs with the image, as Photoshop's Scale Styles does (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 range isValid accepts. Text and shapes are still resampled into pixels, as before.
  • Hue/Saturation, Levels, Invert and the floating-selection merge pass effects: when they rebuild the layer, as the brush and filters already do.
  • docs/project-format.md now 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

  • New LayerEffectsSurviveTests: 9 tests, one per edit, each going through the same entry point as its menu command. All 9 fail on main and pass with this change.
  • The full CompositorTests suite passes locally: 519 passed, 0 failed. FloatingPanelTests and SliderSnapTests were skipped locally; CI runs them on their own.

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>
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.

[BUG] Canvas Size, Image Size, Crop, Trim and some adjustments drop layer effects and live text

1 participant