Copy Paste beachtet OffsetX und OffsetY nicht #263

Closed
opened 2026-09-29 06:07:41 +02:00 by admin · 1 comment

Copy Paste beachtet OffsetX und OffsetY vom parent nicht und das objekt wird dann nicht an der Maus Position eingefügt bzw. nochmal checken wann das genau passiert.

Copy Paste beachtet OffsetX und OffsetY vom parent nicht und das objekt wird dann nicht an der Maus Position eingefügt bzw. nochmal checken wann das genau passiert.
admin added this to the Development project 2026-09-29 06:25:47 +02:00
admin moved this to Next in Development on 2026-09-29 06:25:55 +02:00
admin moved this to Done in Development on 2026-09-29 23:02:13 +02:00
Owner

Done in 6d4247e, wiki 3a46fac (Scene editing, Development).

What you get

  • Paste puts the copy where the pointer is, also when it goes into a parent that has Offset X/Y set.
  • Without a pointer, the copy lands beside the original as the view shows it, also when the original has an offset of its own.

When exactly it happened (as asked above)

  • "Offset X/Y" is the editor offset. It moves where an object is drawn in the Scene View, the game does not see it.
  • Paste mixed two frames. The pointer point comes from the view, with all offsets. Paste turned it into a local position through the parent's plain world transform, without its offset. So the copy landed beside the pointer by exactly the offset of the parent it went into. That is the case when the target is selected, or when the copy keeps the parent of the original.
  • Without a pointer: an original with an offset of its own got its copy beside its game position, which the view does not show.
  • At the top level without offsets nothing was wrong.

Under the hood

  • New editorLocalPositionFor in src/core/properties/transform.ts walks the parent chain with the editor offsets, as the view draws it. Paste uses it.
  • A copied root remembers where the view showed it (ClipRoot.shown) instead of its world position.
  • The copy itself still gets no offset of its own, as since #240. In the game it stands where it was drawn, minus the offsets of its parents.

Tests

unit (clipboard, groups, references, transform)   50 passed, 2 new
e2e 51 (melektaus-atx)                            ALL PASSED - 12 checks, 1 new (51f)
gate (melektaus-atx)                              195 files, 2829 tests, CHECK EXIT 0
CI 42647d3: gate (stein2) green, suite (WSL)      ALL PASSED - 1591 checks, smokes 24/19/21
  • Counter-checks work: without the paste fix both new unit tests fail (copy at 540/470 instead of 500/500), and 51f fails by exactly the 60/-40 offset. With the root remembering its world position again, the own-offset test fails.

Left as it is

  • Re-parenting an object under a parent with an offset keeps its game position, so it jumps in the view by that offset. That is a different rule from paste. Open a new issue if that should change.
Done in `6d4247e`, wiki `3a46fac` (*Scene editing*, *Development*). **What you get** - Paste puts the copy where the pointer is, also when it goes into a parent that has Offset X/Y set. - Without a pointer, the copy lands beside the original as the view shows it, also when the original has an offset of its own. **When exactly it happened** (as asked above) - "Offset X/Y" is the editor offset. It moves where an object is drawn in the Scene View, the game does not see it. - Paste mixed two frames. The pointer point comes from the view, with all offsets. Paste turned it into a local position through the parent's plain world transform, without its offset. So the copy landed beside the pointer by exactly the offset of the parent it went into. That is the case when the target is selected, or when the copy keeps the parent of the original. - Without a pointer: an original with an offset of its own got its copy beside its game position, which the view does not show. - At the top level without offsets nothing was wrong. **Under the hood** - New `editorLocalPositionFor` in `src/core/properties/transform.ts` walks the parent chain with the editor offsets, as the view draws it. Paste uses it. - A copied root remembers where the view showed it (`ClipRoot.shown`) instead of its world position. - The copy itself still gets no offset of its own, as since #240. In the game it stands where it was drawn, minus the offsets of its parents. **Tests** ``` unit (clipboard, groups, references, transform) 50 passed, 2 new e2e 51 (melektaus-atx) ALL PASSED - 12 checks, 1 new (51f) gate (melektaus-atx) 195 files, 2829 tests, CHECK EXIT 0 CI 42647d3: gate (stein2) green, suite (WSL) ALL PASSED - 1591 checks, smokes 24/19/21 ``` - Counter-checks work: without the paste fix both new unit tests fail (copy at 540/470 instead of 500/500), and 51f fails by exactly the 60/-40 offset. With the root remembering its world position again, the own-offset test fails. **Left as it is** - Re-parenting an object under a parent with an offset keeps its game position, so it jumps in the view by that offset. That is a different rule from paste. Open a new issue if that should change.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#263