@@ -247,18 +247,6 @@ - (CGRect)normalizeLayout:(CGRect)layout ancestor:(RNSharedElementTransitionItem
247
247
return [self .superview convertRect: layout fromView: nil ];
248
248
}
249
249
250
- - (UIColor*) getInterpolatedColor : (UIColor*)color1 color2 : (UIColor*)color2 position : (CGFloat )position
251
- {
252
- CGFloat red1, green1, blue1, alpha1;
253
- CGFloat red2, green2, blue2, alpha2;
254
- [color1 getRed: &red1 green: &green1 blue: &blue1 alpha: &alpha1];
255
- [color2 getRed: &red2 green: &green2 blue: &blue2 alpha: &alpha2];
256
- return [UIColor colorWithRed: red1 + ((red2 - red1) * position)
257
- green: green1 + ((green2 - green1) * position)
258
- blue: blue1 + ((blue2 - blue1) * position)
259
- alpha: alpha1 + ((alpha2 - alpha1) * position)];
260
- }
261
-
262
250
- (CGRect ) getInterpolatedLayout : (CGRect )layout1 layout2 : (CGRect )layout2 position : (CGFloat ) position
263
251
{
264
252
return CGRectMake (
@@ -322,24 +310,6 @@ - (UIEdgeInsets) getInterpolatedClipInsets:(CGRect)interpolatedLayout startClipI
322
310
return clipInsets;
323
311
}
324
312
325
- - (RNSharedElementStyle*) getInterpolatedStyle : (RNSharedElementStyle*)style1 style2 : (RNSharedElementStyle*)style2 position : (CGFloat ) position
326
- {
327
- RNSharedElementStyle* style = [[RNSharedElementStyle alloc ]init];
328
- style.opacity = style1.opacity + ((style2.opacity - style1.opacity ) * position);
329
- style.cornerRadius = style1.cornerRadius + ((style2.cornerRadius - style1.cornerRadius ) * position);
330
- style.borderWidth = style1.borderWidth + ((style2.borderWidth - style1.borderWidth ) * position);
331
- style.borderColor = [self getInterpolatedColor: style1.borderColor color2: style2.borderColor position: position];
332
- style.backgroundColor = [self getInterpolatedColor: style1.backgroundColor color2: style2.backgroundColor position: position];
333
- style.shadowOpacity = style1.shadowOpacity + ((style2.shadowOpacity - style1.shadowOpacity ) * position);
334
- style.shadowRadius = style1.shadowRadius + ((style2.shadowRadius - style1.shadowRadius ) * position);
335
- style.shadowOffset = CGSizeMake (
336
- style1.shadowOffset .width + ((style2.shadowOffset .width - style1.shadowOffset .width ) * position),
337
- style1.shadowOffset .height + ((style2.shadowOffset .height - style1.shadowOffset .height ) * position)
338
- );
339
- style.shadowColor = [self getInterpolatedColor: style1.shadowColor color2: style2.shadowColor position: position];
340
- return style;
341
- }
342
-
343
313
- (void ) applyStyle : (RNSharedElementStyle*)style layer : (CALayer *)layer
344
314
{
345
315
layer.opacity = style.opacity ;
@@ -411,7 +381,7 @@ - (void) updateStyle
411
381
UIEdgeInsets interpolatedClipInsets;
412
382
if (!startStyle && !endStyle) return ;
413
383
if (startStyle && endStyle) {
414
- interpolatedStyle = [self getInterpolatedStyle: startStyle style2: endStyle position: _nodePosition];
384
+ interpolatedStyle = [RNSharedElementStyle getInterpolatedStyle: startStyle style2: endStyle position: _nodePosition];
415
385
interpolatedLayout = [self getInterpolatedLayout: startLayout layout2: endLayout position: _nodePosition];
416
386
interpolatedClipInsets = [self getInterpolatedClipInsets: interpolatedLayout startClipInsets: startClipInsets startVisibleLayout: startVisibleLayout endClipInsets: endClipInsets endVisibleLayout: endVisibleLayout];
417
387
interpolatedContentLayout = [self getInterpolatedLayout: startContentLayout layout2: endContentLayout position: _nodePosition];
0 commit comments