Skip to content

Commit

Permalink
Back out "Mitigate flickering on color animations"
Browse files Browse the repository at this point in the history
Summary:
# Changelog:
[Internal] -

Reverting facebook#37925 as causing other animation issues.

Differential Revision: D46985440

fbshipit-source-id: 8a638eb4a0f9247387d1486132576af665ce7b1a
  • Loading branch information
rshest authored and facebook-github-bot committed Jun 24, 2023
1 parent f1d8214 commit d06b5e1
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions packages/react-native/Libraries/Animated/animations/Animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import type AnimatedNode from '../nodes/AnimatedNode';
import type AnimatedValue from '../nodes/AnimatedValue';

import NativeAnimatedHelper from '../NativeAnimatedHelper';
import AnimatedColor from '../nodes/AnimatedColor';
import AnimatedProps from '../nodes/AnimatedProps';
import AnimatedValueXY from '../nodes/AnimatedValueXY';

export type EndResult = {finished: boolean, value?: number, ...};
export type EndCallback = (result: EndResult) => void;
Expand Down Expand Up @@ -77,17 +75,6 @@ export default class Animation {
return result;
}

// Vectorized animations (animations on AnimatedValueXY, AnimatedColor nodes)
// are split into multiple animations for each component that execute in parallel.
// Calling update() on AnimatedProps when each animation completes results in
// potential flickering as all animations that are part of the vectorized animation
// may not have completed yet. For example, only the animation for the red channel of
// an animating color may have been completed, resulting in a temporary red color
// being rendered. So, for now, ignore AnimatedProps that use a vectorized animation.
if (node instanceof AnimatedValueXY || node instanceof AnimatedColor) {
return result;
}

for (const child of node.__getChildren()) {
result.push(...this.__findAnimatedPropsNodes(child));
}
Expand Down

0 comments on commit d06b5e1

Please sign in to comment.