Skip to content

fix(path): append only the active source commands - #1174

Open
dvd233 wants to merge 1 commit into
ecomfe:masterfrom
dvd233:codex/fix-path-append-logical-length
Open

dvd233 wants to merge 1 commit into
ecomfe:masterfrom
dvd233:codex/fix-path-append-logical-length

Conversation

@dvd233

@dvd233 dvd233 commented Oct 9, 2026

Copy link
Copy Markdown

When a path is rebuilt with fewer commands, its backing buffer may retain the previous tail. appendPath() allocates space from the source's logical length but currently copies the whole buffer, so merging a shrunken path can include stale geometry or write past a typed destination's capacity.

Copy only the logical length of each source, preserving existing destination data and leaving source buffers unchanged. Add regression coverage for Array/Float32Array combinations, empty and multiple sources, and the public mergePath() bounding rectangle after a polyline shrinks.

Validation: 79 unit tests across 13 suites and npm run lint pass on Node 18.20.8. The 11 added tests fail 9/11 before the fix and pass 11/11 after it. On Windows, the test command supplies the same test glob with forward slashes to avoid Jest 27 normalizing the .agent-storage parent incorrectly.

npm ci's prepare step and npm run release are blocked by the pre-existing TS2683 error at src/canvas/Painter.ts:1254 (this.dpr inside a callback); this also occurred before the production change, and that file is unchanged.

Fixes #1168.

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.

PathProxy.appendPath copies data.length instead of _len, merging stale commands

1 participant