Skip to content

Commit

Permalink
Adding perspective to projection transform
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed Apr 9, 2024
1 parent a972cf9 commit e51db06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Framer Motion adheres to [Semantic Versioning](http://semver.org/).

Undocumented APIs should be considered internal and may change without warning.

## [11.0.26] 2024-04-10

### Fixed

- Adding `perspective()` to projection transform.

## [11.0.25] 2024-04-03

### Fixed
Expand Down
5 changes: 4 additions & 1 deletion packages/framer-motion/src/projection/styles/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export function buildProjectionTransform(
}

if (latestTransform) {
const { rotate, rotateX, rotateY, skewX, skewY } = latestTransform
const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } =
latestTransform
if (transformPerspective)
transform = `perspective(${transformPerspective}px) ${transform}`
if (rotate) transform += `rotate(${rotate}deg) `
if (rotateX) transform += `rotateX(${rotateX}deg) `
if (rotateY) transform += `rotateY(${rotateY}deg) `
Expand Down

0 comments on commit e51db06

Please sign in to comment.