Skip to content

Commit 5ae51f1

Browse files
committed
fix(studio): a GSAP scaleX or scaleY tween also keeps a resize on the GSAP route
They are GSAP's names for parts of the one CSS scale the box writer sets.
1 parent e07cc39 commit 5ae51f1

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎packages/studio/src/components/editor/manualOffsetDrag.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ describe("a resize's anchor member", () => {
686686
expect(member.element.style.getPropertyValue("translate")).toBe("-10.25px 3.5px");
687687
});
688688

689-
it.each(["width", "maxWidth", "minHeight", "flexBasis", "scale"])(
689+
it.each(["width", "maxWidth", "minHeight", "flexBasis", "scale", "scaleX"])(
690690
"leaves a box whose %s GSAP tweens, which the CSS box writer also sets, to the GSAP writer",
691691
(channel) => {
692692
expect(anchorMember({ [channel]: 300 }).plainTranslate).toBe(false);

‎packages/studio/src/hooks/gsapRuntimeKeyframes.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,13 @@ export function gsapWritesPosition(el: Element): boolean {
447447
return !!cache?.renderTransform || gsapWritesChannels(el, MOVE_CHANNELS);
448448
}
449449

450-
const BOX_CHANNELS = BOX_SIZE_STYLE_PROPS.map((prop) =>
451-
prop.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()),
452-
);
450+
const BOX_CHANNELS = [
451+
...BOX_SIZE_STYLE_PROPS.map((prop) =>
452+
prop.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()),
453+
),
454+
"scaleX",
455+
"scaleY",
456+
];
453457

454458
/** GSAP owns this element's box: its position, or any property the CSS box writer sets. Else a resize writes CSS. */
455459
export function gsapWritesBox(el: Element): boolean {

0 commit comments

Comments
 (0)