Skip to content

Commit

Permalink
Fixed translate syntax when not using scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
Havunen committed Jan 24, 2025
1 parent d45ab32 commit b7c4352
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/inferno-animation/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ export function getDimensions(node: HTMLElement | SVGElement): Dimensions {
};
}

export function getGeometry(node: HTMLElement | SVGElement): Dimensions {
const { x, y, width, height } = node.getBoundingClientRect();
return { x, y, width, height };
export function getGeometry(node: HTMLElement | SVGElement): DOMRect {
return node.getBoundingClientRect()
}

export function setTransform(
Expand All @@ -124,7 +123,7 @@ export function setTransform(
node.style.transformOrigin = '0 0';
node.style.transform = `translate(${x}px,${y}px) scale(${scaleX},${scaleY})`;
} else {
node.style.transform = `translate('${x}px,${y}px)`;
node.style.transform = `translate(${x}px,${y}px)`;
}
}

Expand Down

0 comments on commit b7c4352

Please sign in to comment.