mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-04 04:46:59 +00:00
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.
This commit is contained in:
@@ -686,7 +686,7 @@ describe("a resize's anchor member", () => {
|
|||||||
expect(member.element.style.getPropertyValue("translate")).toBe("-10.25px 3.5px");
|
expect(member.element.style.getPropertyValue("translate")).toBe("-10.25px 3.5px");
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each(["width", "maxWidth", "minHeight", "flexBasis", "scale"])(
|
it.each(["width", "maxWidth", "minHeight", "flexBasis", "scale", "scaleX"])(
|
||||||
"leaves a box whose %s GSAP tweens, which the CSS box writer also sets, to the GSAP writer",
|
"leaves a box whose %s GSAP tweens, which the CSS box writer also sets, to the GSAP writer",
|
||||||
(channel) => {
|
(channel) => {
|
||||||
expect(anchorMember({ [channel]: 300 }).plainTranslate).toBe(false);
|
expect(anchorMember({ [channel]: 300 }).plainTranslate).toBe(false);
|
||||||
|
|||||||
@@ -447,9 +447,13 @@ export function gsapWritesPosition(el: Element): boolean {
|
|||||||
return !!cache?.renderTransform || gsapWritesChannels(el, MOVE_CHANNELS);
|
return !!cache?.renderTransform || gsapWritesChannels(el, MOVE_CHANNELS);
|
||||||
}
|
}
|
||||||
|
|
||||||
const BOX_CHANNELS = BOX_SIZE_STYLE_PROPS.map((prop) =>
|
const BOX_CHANNELS = [
|
||||||
prop.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()),
|
...BOX_SIZE_STYLE_PROPS.map((prop) =>
|
||||||
);
|
prop.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()),
|
||||||
|
),
|
||||||
|
"scaleX",
|
||||||
|
"scaleY",
|
||||||
|
];
|
||||||
|
|
||||||
/** GSAP owns this element's box: its position, or any property the CSS box writer sets. Else a resize writes CSS. */
|
/** GSAP owns this element's box: its position, or any property the CSS box writer sets. Else a resize writes CSS. */
|
||||||
export function gsapWritesBox(el: Element): boolean {
|
export function gsapWritesBox(el: Element): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user