Skip to content

Commit

Permalink
Update BaseViewManager.java
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer authored Jan 30, 2019
1 parent 6829e94 commit 8c8a51c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ private static void setTransformProperty(View view, ReadableArray transforms) {
float scale = DisplayMetricsHolder.getScreenDisplayMetrics().density;

// The following converts the matrix's perspective to a camera distance
// such that the camera perspective looks the same on Android and iOS
// While comparing the output between android and ios, it seemed like
// the native android implementation removed the screen density from the
// calculation, so taking square and also the normalization value at
// sqrt(5) produced an exact replica with ios
// such that the camera perspective looks the same on Android and iOS.
// The native Android implementation removed the screen density from the
// calculation, so squaring and a normalization value of
// sqrt(5) produced an exact replica with ios.
// For more information, see https://github.com/facebook/react-native/pull/18302
float normalizedCameraDistance = scale * scale * cameraDistance * CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER;
view.setCameraDistance(normalizedCameraDistance);

Expand Down

0 comments on commit 8c8a51c

Please sign in to comment.