Fix border-radius percentage formula typo (#44529)

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

The percentage formula was incorrect. We actually want to consider the shorter side as 100%. If we set a radius > minimum side there are no changes reflected. This is correct on iOS.

D56943825's summary also highlights the reasoning.

Changelog:
[Android][Fixed] Border-Radius percentages are now correctly resolved.

Reviewed By: NickGerleman

Differential Revision: D57214561

fbshipit-source-id: 45125b80289506a6dd51d24451e2b0222cd227c0
This commit is contained in:
Jorge Cabiedes Acosta
2024-05-13 11:10:40 -07:00
committed by Facebook GitHub Bot
parent 651c1d2cf5
commit 082e29ed4e
@@ -63,7 +63,7 @@ public class LengthPercentage(
public fun resolve(width: Float, height: Float): Float {
if (unit == LengthPercentageType.PERCENT) {
return (value / 100) * Math.max(width, height)
return (value / 100) * Math.min(width, height)
}
return value