SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Fix some edge cases with box shadow (#50638)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50638

There were two issues with inset shadows here that I fixed

* If spread was big enough it would "invert" the clear region. [RectF's inset](https://developer.android.com/reference/android/graphics/RectF#inset(float,%20float)) method does not bound to a 0x0 rect, it will instead start making the rect bigger if the inset value is large enough.
* If the clear region was outside the rect the shadow disappeared. This is because [Canvas's drawDoubleRoundRect](https://developer.android.com/reference/android/graphics/Canvas#drawDoubleRoundRect(android.graphics.RectF,%20float[],%20android.graphics.RectF,%20float[],%20android.graphics.Paint)) will fail to draw if the inner rect is not completely inside of the outer.

Changelog: [Android][Fixed] - Fix inset shadow edge cases

Reviewed By: GijsWeterings

Differential Revision: D72833275

fbshipit-source-id: 3f42fb767630319c51a380f8ea28d682df9771a6
J
Joe Vilches committed
0929697a6df9ab5a3654c0077bb95427eae77b4c
Parent: ab7ef77
Committed by Facebook GitHub Bot <[email protected]> on 4/14/2025, 8:57:54 PM