Files
hyperframes/packages
Miguel Ángel 6b341b0d84 fix(studio): a resized corner stays on the pointer when the size rounds to whole pixels (#5213)
* fix(studio): a resized corner stays on the pointer when the size rounds to whole pixels

Resized sizes stay on whole CSS pixels (GSAP centres a -50% translate from the
integer offset size), so the centre-anchored resize left the grabbed corner up to
a third of a pixel times the element's scale off the pointer: 0.53 px on a 1.5x
scaled layer. The centre pin now takes half the rounding remainder along the
element's rendered edges, so the grabbed corner lands where the wanted size puts
it while the written size stays whole.

* fix(studio): a scale resize saves the box exactly where it was dropped

finalizeScaleResizeCommit skipped its position correction whenever the box sat
within 0.5 px of the drop point on each axis, so a sub-pixel drop (now the
norm, with the grabbed corner on the pointer) saved up to half a pixel off.
It now skips only when the correction rounds to nothing at the precision the
file is written in.

* fix(studio): a scale resize lands centred on the box that was dropped

finalizeScaleResizeCommit lined the committed box up with the drop by its
top-left corner. When one scale cannot reproduce the dragged width and height
(the draft rounds each to whole pixels), that put the whole gap on the far
edges, up to half a pixel. The resize is centre-anchored, so it now lines up
centres and the gap splits evenly.

* chore(studio): keep the complexity note on the resize intercept, not the new helper

* test(studio): bank the two scaled resize cases that now pass the edit accuracy bench

* fix(studio): a scale resize leaves animated positions alone and mirrored corners track

* test(studio): bank only the two newly passing scaled resize cases

* fix(studio): a mirrored or parent-rotated layer's resize corner tracks the pointer

* fix(studio): a resize corner on a skewed layer picks its side from the box's own edges

* fix(studio): resizing a layer that renders with no area moves nothing
2026-10-09 19:20:01 +00:00
..
2026-10-08 23:28:49 +00:00
2026-10-08 23:28:49 +00:00
2026-10-08 23:28:49 +00:00