Repository navigation
Layers: drop vector masks on groups, adjustment, fill and smart object layers (#20646) - #20731
Higgs32584 wants to merge 2 commits into
Conversation
…t layers (storytold#20646) vector_mask_drop_target accepted only pixel and type layers (and shape paths), while layer.vectorMask.add accepts any layer that is not a shape. Every non-shape layer is now a drop target, with the same lock, frame and Background checks as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…orytold#20646) clippy::type-complexity flagged the inline (&str, fn(&mut Session)) array type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A vector mask dragged in the Layers panel now lands on groups, adjustment layers, fill layers and smart objects.
Fixes #20646.
What the user saw. Dragging a vector mask onto a group, adjustment layer, fill layer or smart object showed no drop highlight and did nothing, even though Layer › Vector Mask adds one to those layers.
Cause.
vector_mask_drop_target(crates/engine-core/src/cmd/vector_cmds/vector_mask.rs) matched onlyRasterandTextcontent (plusShape, whose path is replaced) and returnedNonefor every other kind.layer.vectorMask.addrefuses only shape layers.Change. Every non-shape layer is now an
EmptyMask/ExistingMasktarget. A shape layer with locked pixels still refuses, as before. The earlier checks are unchanged: same layer, Background, all-locks on either layer, frames. The Layers panel highlight, the drop action and the headlesslayer.vectorMask.moveToall call this one function, so they change together. No UI code changed.Test.
vector_mask_drops_on_groups_adjustments_fills_and_smart_objects_like_add(vector_mask_move_tests.rs). For each of the four kinds it checks that the drop moves the mask onto the layer, leaves the source with no mask, and keeps the target's content. It then checks that a second drop on the now-masked layer needsreplace. With the fix reverted it fails on the group ("the vector mask cannot be dropped on that layer").an_unconfirmed_or_invalid_vector_mask_drop_refuses_without_historylisted a drop onto a group as one that must be refused. That row asserted the behaviour this issue reports as a bug, so I removed it. The test's other refusal rows (unconfirmed replace, Background, self, a badreplacevalue) are unchanged.Verification (local, Windows):
cargo test -p photocraft-engine-core --lib vector_mask: 31 passed.cargo clippy -p photocraft-engine-core --all-targets -- -D warnings: clean.rustfmt --checkon both changed files: clean.Not run locally (left to CI): the full workspace test suite,
cargo xtask layers,cargo xtask wasmand the panic_hunt sweep. No command ids changed, soparityandpanel-commandsdo not apply.🤖 Generated with Claude Code
Summary by CodeRabbit