Skip to content

Commit

Permalink
Merge pull request #2442 from framer/fix/circinout
Browse files Browse the repository at this point in the history
Fix circInOut easing
  • Loading branch information
mergetron[bot] authored Dec 8, 2023
2 parents 8d3d669 + db1af26 commit a0be835
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
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.

## [10.16.16] 2023-12-08

### Fixed

- `circInOut` easing fixed.

## [10.16.15] 2023-12-07

### Fixed
Expand Down
8 changes: 8 additions & 0 deletions packages/framer-motion/src/easing/__tests__/circ.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { circIn, circOut, circInOut } from "../circ"

describe("circ easing", () => {
test("circInOut is correct", () => {
expect(circInOut(0.25)).toBe(circIn(0.5) / 2)
expect(circInOut(0.75)).toBe(0.5 + circOut(0.5) / 2)
})
})
2 changes: 1 addition & 1 deletion packages/framer-motion/src/easing/circ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { EasingFunction } from "./types"

export const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))
export const circOut = reverseEasing(circIn)
export const circInOut = mirrorEasing(circOut)
export const circInOut = mirrorEasing(circIn)
4 changes: 2 additions & 2 deletions packages/framer-motion/src/motion/__tests__/waapi.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,8 @@ describe("WAAPI animations", () => {
expect(ref.current!.animate).toBeCalledWith(
{
opacity: [
0, 0.36000000000000004, 0.440908153700972,
0.459091846299028, 0.5400000000000001, 0.9,
0, 0.03756818745397441, 0.18000000000000008, 0.72,
0.8624318125460256, 0.9,
],
offset: undefined,
},
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7981,8 +7981,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.16.14
framer-motion-3d: ^10.16.14
framer-motion: ^10.16.15
framer-motion-3d: ^10.16.15
path-browserify: ^1.0.1
react: ^18.2.0
react-dom: ^18.2.0
Expand Down Expand Up @@ -8048,14 +8048,14 @@ __metadata:
languageName: unknown
linkType: soft

"framer-motion-3d@^10.16.14, framer-motion-3d@workspace:packages/framer-motion-3d":
"framer-motion-3d@^10.16.15, 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.16.14
framer-motion: ^10.16.15
react-merge-refs: ^2.0.1
peerDependencies:
"@react-three/fiber": ^8.2.2
Expand All @@ -8065,7 +8065,7 @@ __metadata:
languageName: unknown
linkType: soft

"framer-motion@^10.16.14, framer-motion@workspace:packages/framer-motion":
"framer-motion@^10.16.15, framer-motion@workspace:packages/framer-motion":
version: 0.0.0-use.local
resolution: "framer-motion@workspace:packages/framer-motion"
dependencies:
Expand Down

0 comments on commit a0be835

Please sign in to comment.