Skip to content

Commit

Permalink
Latest
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry authored and mergatron[bot] committed May 22, 2024
1 parent 738c3b4 commit 933dbe2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import { clamp } from "../../utils/clamp"
import { invariant } from "../../utils/errors"
import { frameloopDriver } from "./drivers/driver-frameloop"
import { getFinalKeyframe } from "./waapi/utils/get-final-keyframe"
import { frameData } from "../../frameloop"
let firstOne = true

type GeneratorFactory = (
options: ValueAnimationOptions<any>
) => KeyframeGenerator<any>
Expand Down Expand Up @@ -383,15 +382,6 @@ export class MainThreadAnimation<
)
}

if (firstOne && this.options.name === "x") {
console.log(
state.value,
frameData.isProcessing,
frameData.timestamp
)
firstOne = false
}

if (onUpdate) {
onUpdate(state.value)
}
Expand Down Expand Up @@ -462,9 +452,8 @@ export class MainThreadAnimation<
if (this.holdTime !== null) {
this.startTime = now - this.holdTime
} else if (!this.startTime || this.state === "finished") {
this.startTime = now + 50
this.startTime = now
}
this.options.name === "x" && console.log("start time", this.startTime)

if (this.state === "finished") {
this.updateFinishedPromise()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function handoffOptimizedAppearAnimation(
if (handoffFrameTime === undefined) {
handoffFrameTime = performance.now()
}
console.log("elapsed", handoffFrameTime - startTime)

/**
* We use main thread timings vs those returned by Animation.currentTime as it
* can be the case, particularly in Firefox, that currentTime doesn't return
Expand Down
6 changes: 2 additions & 4 deletions packages/framer-motion/src/render/utils/KeyframesResolver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { frame } from "../../frameloop"
import { microtask } from "../../frameloop/microtask"
import { MotionValue } from "../../value"
import type { VisualElement } from "../VisualElement"
import { removeNonTranslationalTransform } from "../dom/utils/unit-conversion"
Expand Down Expand Up @@ -152,8 +151,8 @@ export class KeyframeResolver<T extends string | number = any> {

if (!isScheduled) {
isScheduled = true
microtask.read(readAllKeyframes)
microtask.resolveKeyframes(measureAllKeyframes)
frame.read(readAllKeyframes)
frame.resolveKeyframes(measureAllKeyframes)
}
} else {
this.readKeyframes()
Expand Down Expand Up @@ -212,7 +211,6 @@ export class KeyframeResolver<T extends string | number = any> {
measureEndState() {}

complete() {
console.log("keyframes resolved", this.name)
this.isComplete = true

this.onComplete(
Expand Down

0 comments on commit 933dbe2

Please sign in to comment.