aws-samples / aws-samples/sample-drawio-mcp
set_parent does not adjust child geometry coordinates when reparenting
- Dominant language
- JavaScript
- Stars
- 21
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Report
**Tool**: `set_parent`
## Steps to Reproduce
1. Insert vertex A at canvas position (50, 50)
2. Insert container B at canvas position (300, 200)
3. Call `set_parent(cell_id="A", parent_id="B")`
## Expected Behavior
A's geometry is adjusted to (-250, -150) so that its canvas position is preserved after reparenting.
## Actual Behavior
A's geometry remains (50, 50). Since coordinates become relative to the parent after reparenting, A visually jumps to canvas position (350, 250).
## Impact
Cannot use `set_parent` to move existing cells into containers — the cell always ends up at the wrong position. Workaround: define parent-child relationships in the initial XML with relative coordinates from the start.
Contributor guide
Assessment
This issue has not been assessed yet.