Files
hyperframes/packages
ukimsanov 0a49aec461 fix(studio): anchor corner-resize to the element's real corner, not its AABB
Resizing a rotated element from an NW/NE/SW handle made it jump/lag and left
the selection box detached from the element (empty gap when shrinking); the SE
handle was fine. Root cause: the anchor translation that keeps the opposite
corner fixed was computed from the axis-aligned bounding-box delta
(originWidth − measuredWidth) and pushed through GSAP x/y. GSAP x/y is a
screen-space translate, but a rotated element grows about its transform-origin
in its LOCAL frame, so its real corners move along rotated axes — the AABB
delta then slid the fixed corner every frame (drift ∝ drag distance, up to
~10px at −4° on a 640×360 image; zero only when unrotated, which is why SE and
axis-aligned elements looked correct).

Fix: pin the actual (rotation-aware) fixed corner. New
elementCornerOverlayPoints() transforms the element's border-box corners
through its live transform matrix into overlay coords; startGesture captures
the fixed corner (opposite the grabbed handle) at gesture start; the
pointermove anchor is now (fixedStart − fixedAfterSize), the exact screen shift
needed to return that corner home. Falls back to the old AABB delta only when
the live DOM can't be measured. The box left/top is re-read from the element's
post-anchor AABB so it hugs the true bounds every frame.

Verified live in Studio against a rotated (−4°) image via the shipped
functions: fixed-corner drift 0.00px on every sampled frame for NW/NE/SW
(was up to 10.58px), and 0.00px across 0°/−4°/30°.
2026-07-10 10:24:00 -07:00
..
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00
2026-07-10 09:57:48 -07:00