Skip to content

Commit

Permalink
Fix type conversion in RCTViewComponentView
Browse files Browse the repository at this point in the history
Summary:
changelog: [internal]

[CALayer opacity] is of type `float`, not `CGFloat`.

Reviewed By: philIip

Differential Revision: D33058967

fbshipit-source-id: 98b214e32f6d35e904a7abb0e01c2d01da50a285
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Dec 14, 2021
1 parent 73a04d1 commit 102b9f3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
// `opacity`
if (oldViewProps.opacity != newViewProps.opacity &&
![_propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN containsObject:@"opacity"]) {
self.layer.opacity = (CGFloat)newViewProps.opacity;
self.layer.opacity = (float)newViewProps.opacity;
needsInvalidateLayer = YES;
}

Expand Down Expand Up @@ -227,7 +227,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &

// `shadowOpacity`
if (oldViewProps.shadowOpacity != newViewProps.shadowOpacity) {
self.layer.shadowOpacity = (CGFloat)newViewProps.shadowOpacity;
self.layer.shadowOpacity = (float)newViewProps.shadowOpacity;
needsInvalidateLayer = YES;
}

Expand Down Expand Up @@ -417,7 +417,7 @@ - (void)prepareForRecycle
self.layer.transform = RCTCATransform3DFromTransformMatrix(props.transform);
}
if ([_propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN containsObject:@"opacity"]) {
self.layer.opacity = (CGFloat)props.opacity;
self.layer.opacity = (float)props.opacity;
}

_propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN = nil;
Expand Down

0 comments on commit 102b9f3

Please sign in to comment.