fix(studio): a drag on a centred element no longer flashes off-centre on release

This commit is contained in:
Miguel Angel Simon Sierra
2026-10-01 12:16:37 -07:00
parent 594ed21957
commit 2798d026f7
@@ -1,4 +1,5 @@
import type { GsapAnimation } from "@hyperframes/core/gsap-parser";
import { PROPERTY_GROUPS } from "@hyperframes/parsers/gsap-constants";
import type { DomEditSelection } from "../components/editor/domEditingTypes";
import { usePlayerStore } from "../player/store/playerStore";
import { resolveTweenStart, resolveTweenDuration } from "../utils/globalTimeCompiler";
@@ -179,7 +180,9 @@ async function commitFlatViaKeyframes(
if (runtime && ts !== null) {
const { gsapLib, el, mainTl } = runtime;
const draggedValues: Record<string, number> = {};
for (const key of Object.keys(properties)) {
// Clearing x/y clears GSAP's whole transform, and the seek does not bring back an xPercent
// set outside the timeline, so the restore below carries every position channel.
for (const key of new Set([...Object.keys(properties), ...PROPERTY_GROUPS.position])) {
const v = Number(gsapLib.getProperty(el, key));
if (Number.isFinite(v)) draggedValues[key] = v;
}