Skip to content

feat(shapes): path marquees, Reverse Path Direction, Round Corners, Layer Contents and per-shape SVG rasterising - #1107

Open
eliasx45 wants to merge 8 commits into
storytold:mainfrom
eliasx45:upstream/shape-editing
Open

eliasx45 wants to merge 8 commits into
storytold:mainfrom
eliasx45:upstream/shape-editing

Conversation

@eliasx45

@eliasx45 eliasx45 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Shape and Properties editing:

  • Reverse Path Direction (⇄) on Path / Rectangle / Ellipse / Polystar rows in the Timeline
    (shape.reversePathDirection {layer?, prop?, reversed?}, one undo step; Path Direction stays
    hidden as a row). Scripting can set ADBE Vector Shape Direction with After Effects' values (1
    Default, 3 Reversed) and reads them back the same way.
  • Round Corners: layer.roundCorners (a solid becomes a rounded shape layer; a shape
    rectangle gets roundness), Layer ▸ Create ▸ Round Corners, roundness on new shapes, an MCP test;
    translated in all ten menu catalogues.
  • Viewer selection: mask marquees can start over full-frame artwork, and explicitly selected shape vertices keep marquee editing. Merely selecting a shape still allows interior dragging to move Position; direct vertex grabs edit geometry, and empty vertex marquees clear the vertex selection without changing the selected layer.
  • Properties panel: a Layer Contents section for shape layers and a Roundness row for solids;
    long row labels push their values right instead of overlapping them.
  • SVG: each shape rasterises only inside its own bounds instead of a canvas-sized mask (an
    Illustrator layer went from 556 s to 5–7 s a frame); pixels match except a few anti-aliased edge
    pixels; a test checks coverage stays inside the rectangle.

Left out of #858's version: "toolbar Fill/Stroke kinds apply to selected shape layers", since
#732 (merged) already does that. Its blend-mode / opacity part isn't carried over; we can send it
on top of #732 separately if you want it.

Why

After Effects parity for shape editing, and the SVG rasteriser cost (shapes × canvas area). Split
out of #858 as asked.

How tested

  • Tests in engine/src/tests_tail.rs, script/src/tests.rs, ui-egui/tests/ui_timeline_shapes.rs,
    ui-egui/tests/ui_properties.rs, automation/src/tests.rs, svg/src/tests.rs; written with the
    changes, not re-run on this branch.
  • rustfmt --check and cargo check --all-targets on the affected crates on current upstream
    main (the new tests were appended next to tests added upstream since).

Viewer selection follow-up (2026-10-15)

The marquee improvement is ported together with the correction from fork commit 9dd83b7a, rather than importing the fork-only regression that made every visible shape path consume interior drags. Upstream previously required empty canvas to start a mask marquee; this adds the useful full-frame behavior while retaining ordinary layer movement. No unrelated panel/window changes from the prerequisite fork commit are included.

  • Two focused UI regressions cover ordinary shape Position movement, unchanged Anchor Point and geometry, one-step Undo, direct vertex editing, explicit vertex marquees, full-frame mask selection and empty marquee selection clearing.
  • Validation: rustfmt --edition 2024 --check on the two changed Rust files; cargo check -p effectcraft-ui-egui --all-targets; strict scoped Clippy.
  • Earlier native macOS verification on the fork: an 80×60 interior drag changed only Position, Undo restored it, and a 20×20 direct vertex drag changed only that vertex. This adapted contribution branch was compile-checked; the new Rust regression tests were not executed under the owner's daytime policy. Full CI and a new native app build were not run.

Upstream integration update

Merged current upstream main while preserving the latest layer-dragging fix alongside mask/shape marquees. Formatting and strict workspace/all-target release Clippy passed. UI regression targets are compiled by that check; interactive visual QA and the full runtime suite were not rerun for this update.

0Elias71 and others added 6 commits October 12, 2026 19:21
… rows

- shape.reversePathDirection {layer?, prop?, reversed?}: one undoable step; toggles the
  selected items without prop. The Timeline shows the ⇄ button on shape item rows; Path
  Direction stays hidden as a property row. Trim Paths then runs the other way.
- Scripting: ADBE Vector Shape Direction is settable despite being hidden, with After
  Effects' values (1 Default, 2 normal, 3 Reversed) mapped to ours (0/1) and read back as 1/3.
- AEP import: AE's Reversed (3) imported as 2 (not reversed); now maps to 1.
- Go to Work Area Start/End get AE's defaults Shift+Home / Shift+End.

Upstream port: the Shift+Home / Shift+End work-area bindings and the After Effects-import part are left out (they build on fork work not upstream yet).

(cherry picked from commit 7782ab0)

(cherry picked from commit c21cb5b74430cae267a46fdc835a4cf1ed32fc9a)
(cherry picked from commit f79c41e)

(cherry picked from commit 60e6a01b0fa4d0decea3ceca244fddf5a1b75edf)
…shape rect roundness), roundness on new shapes, Layer › Create › Round Corners, MCP test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rc1XNFw6vDovyoYpwHj9Py
(cherry picked from commit f3cd3cc)

# Conflicts:
#	crates/engine/src/commands/mod.rs

(cherry picked from commit cec4b6633045617064a6857d4a0c3aea1ae8408f)
(cherry picked from commit 63da1f2)

(cherry picked from commit ee6fdecae2d95f77fa6e9ed09ed113e81455cb65)
…ow for solids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rc1XNFw6vDovyoYpwHj9Py
(cherry picked from commit 33d849f)

# Conflicts:
#	crates/ui-egui/src/panels/properties.rs
#	crates/ui-egui/tests/ui/main.rs

(cherry picked from commit a593488c211864735b3a6e8f087159235ed8184b)
(cherry picked from commit 8457f32)

(cherry picked from commit 5ff0722dd1ece25b8a9af5ced6d33712a0be36e2)
…pping

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rc1XNFw6vDovyoYpwHj9Py
(cherry picked from commit 5e86b07)

(cherry picked from commit e10c7e62a63a282e695d982d86e78554059fb1ff)
(cherry picked from commit 99ae078)

(cherry picked from commit 184389c99e6588100ca85b1e6c52f03a25fed374)
Every fill and stroke allocated a coverage mask the size of the whole canvas and painted every
canvas pixel, so a vector file cost shapes × canvas area: SceneYard "Retro Desktop Movie
Popups" spent 556 s per frame on one 4001×2501 Illustrator layer (568 s a frame in all).

Each shape now rasterises and paints only inside its device-space bounding box (+1 px of
anti-aliasing) clipped to the canvas; a stroke uses the bounds of its outline. The frame
renders in 5–7 s (bench, no cache). Pixels match the whole-canvas version except a few
anti-aliased edge pixels (float rounding of the re-based transform). A test checks that every
pixel a shape covers lies inside its rectangle, and pins the output.

(cherry picked from commit 58d369b)

(cherry picked from commit 7fdbbc5188ab5d420448f47a726bee6a046e6936)
(cherry picked from commit 5efd7aa)

(cherry picked from commit c0e929f436b7a01c07499df142b048914f60e505)
…logues

Every fixed menu entry needs a translation in each catalogue
(i18n::tests::every_translation_key_exists_in_the_actual_menu_tree).

(cherry picked from commit b9d0677a2e6d9cc1b05c5ac9175f7e374fe7e5c9)
Port the mask marquee portion of109cb2e4 together with the corrected shape-selection routing from9dd83b7a. Keep unrelated fork panel and vertex-displacement changes out.

UI all-target check and strict clippy pass. Regression tests compiled only under owner daytime policy; no native app build or full CI.
@eliasx45 eliasx45 changed the title feat(shapes): Reverse Path Direction, Round Corners, Layer Contents in Properties, per-shape SVG rasterising feat(shapes): path marquees, Reverse Path Direction, Round Corners, Layer Contents and per-shape SVG rasterising Oct 15, 2026
@bflatastic

Copy link
Copy Markdown
Member

Hi @eliasx45, thanks for this PR! main has changed a lot since it was opened, and it now conflicts with main, so it needs a rebase before we can review it for merging.

Most of the conflict comes from the shared module layout (#2491), which moved or split files this PR touches:

  • crates/engine/src/commands/layer.rs: its folder moved to crates/engine/src/cmd/
  • crates/engine/src/commands/mod.rs: its folder moved to crates/engine/src/cmd/
  • crates/engine/src/commands/shape_stroke.rs → crates/engine/src/cmd/shape_stroke.rs
  • crates/engine/src/commands/shape_tool.rs → crates/engine/src/cmd/shape_tool.rs
  • crates/engine/src/tests_tail.rs → crates/engine/src/tests/tail.rs
  • crates/ui-egui/src/panels/viewer.rs was split: most of its code is now in panels/viewer/*.rs
  • crates/ui-egui/tests/ui_timeline_shapes.rs → crates/ui-egui/tests/it/ui_timeline_shapes.rs
  • crates/ui-egui/tests/ui_viewer.rs → crates/ui-egui/tests/it/ui_viewer.rs

When you rebase, please also make sure it fits the other recent changes:

CI (cargo xtask ci) now runs on PRs. Once it's green on the rebased branch, we'll take a look. Thank you!

This branch has not been deployed

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

4 participants