Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support subpixel layouts in layout animations #2235

Merged
merged 9 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions dev/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "framer-motion--dev",
"version": "10.12.21",
"version": "10.12.22-alpha.2",
"private": true,
"scripts": {
"dev": "webpack serve --config ./webpack/config.js --hot"
},
"dependencies": {
"@react-three/drei": "^7.27.3",
"@react-three/fiber": "^8.2.2",
"framer-motion": "^10.12.21",
"framer-motion-3d": "^10.12.21",
"framer-motion": "^10.12.22-alpha.2",
"framer-motion-3d": "^10.12.22-alpha.2",
"path-browserify": "^1.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "10.12.21",
"version": "10.12.22-alpha.2",
"packages": [
"packages/*"
],
Expand Down
6 changes: 3 additions & 3 deletions packages/framer-motion-3d/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "framer-motion-3d",
"version": "10.12.21",
"version": "10.12.22-alpha.2",
"description": "A simple and powerful React animation library for @react-three/fiber",
"main": "dist/cjs/index.js",
"module": "dist/es/index.mjs",
Expand Down Expand Up @@ -46,7 +46,7 @@
"postpublish": "git push --tags"
},
"dependencies": {
"framer-motion": "^10.12.21",
"framer-motion": "^10.12.22-alpha.2",
"react-merge-refs": "^2.0.1"
},
"peerDependencies": {
Expand All @@ -60,5 +60,5 @@
"@react-three/test-renderer": "^9.0.0",
"@rollup/plugin-commonjs": "^22.0.1"
},
"gitHead": "19af5092ea56b5a815446aa5855680300eeec80d"
"gitHead": "1694c651a6519f1d4d6cb879c74bee44546522bc"
}
2 changes: 1 addition & 1 deletion packages/framer-motion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "framer-motion",
"version": "10.12.21",
"version": "10.12.22-alpha.2",
"description": "A simple and powerful React and JavaScript animation library",
"main": "dist/cjs/index.js",
"module": "dist/es/index.mjs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2091,8 +2091,9 @@ const defaultLayoutTransition = {
}

function roundAxis(axis: Axis): void {
axis.min = Math.round(axis.min)
axis.max = Math.round(axis.max)
// Round to the nearest .5 pixels to support subpixel layouts
axis.min = Math.round(axis.min * 2) / 2
axis.max = Math.round(axis.max * 2) / 2
}

function roundBox(box: Box): void {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7844,8 +7844,8 @@ __metadata:
cache-loader: ^1.2.5
convert-tsconfig-paths-to-webpack-aliases: ^0.9.2
fork-ts-checker-webpack-plugin: ^6.2.0
framer-motion: ^10.12.21
framer-motion-3d: ^10.12.21
framer-motion: ^10.12.22-alpha.2
framer-motion-3d: ^10.12.22-alpha.2
path-browserify: ^1.0.1
react: ^18.2.0
react-dom: ^18.2.0
Expand Down Expand Up @@ -7911,14 +7911,14 @@ __metadata:
languageName: unknown
linkType: soft

"framer-motion-3d@^10.12.21, framer-motion-3d@workspace:packages/framer-motion-3d":
"framer-motion-3d@^10.12.22-alpha.2, framer-motion-3d@workspace:packages/framer-motion-3d":
version: 0.0.0-use.local
resolution: "framer-motion-3d@workspace:packages/framer-motion-3d"
dependencies:
"@react-three/fiber": ^8.2.2
"@react-three/test-renderer": ^9.0.0
"@rollup/plugin-commonjs": ^22.0.1
framer-motion: ^10.12.21
framer-motion: ^10.12.22-alpha.2
react-merge-refs: ^2.0.1
peerDependencies:
"@react-three/fiber": ^8.2.2
Expand All @@ -7928,7 +7928,7 @@ __metadata:
languageName: unknown
linkType: soft

"framer-motion@^10.12.21, framer-motion@workspace:packages/framer-motion":
"framer-motion@^10.12.22-alpha.2, framer-motion@workspace:packages/framer-motion":
version: 0.0.0-use.local
resolution: "framer-motion@workspace:packages/framer-motion"
dependencies:
Expand Down