Skip to content

Commit 121eeb6

Browse files
committed
extrapolateType固定设为clamp
1 parent ad8eee3 commit 121eeb6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/animated_interpolation.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,20 @@ DoubleCallBack<double> createInterpolation(InterpolationConfigType config) {
163163

164164
ExtrapolateType extrapolateRight = config.extrapolateRight;
165165
if (config.extrapolate != null) extrapolateRight = config.extrapolate;
166-
166+
///
167+
/// 由于flutter中Curve.transform使用assert限制在0-1之间
168+
/// 所以其ExtrapolateType固定设置为clamp,此处于React Native
169+
/// 中不同
170+
///
167171
return interpolate(
168172
input: input,
169173
inputMin: config.inputRange[range],
170174
inputMax: config.inputRange[range + 1],
171175
outputMin: config.outputRange[range],
172176
outputMax: config.outputRange[range + 1],
173177
curve: config.curve,
174-
extrapolateLeft: extrapolateLeft,
175-
extrapolateRight: extrapolateRight,
178+
extrapolateLeft: ExtrapolateType.clamp,
179+
extrapolateRight: ExtrapolateType.clamp,
176180
);
177181
};
178182
}

0 commit comments

Comments
 (0)