fix for bottom adjustment (#46475)

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

fm.top is negative, so we want to add in order to decrease the absolute value, but fm.bottom is positive, so we need to subtract instead here

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D62612192

fbshipit-source-id: fc942abcb5a1ddedd6547aca66a188736e4ec029
This commit is contained in:
Melissa Liu authored and Facebook GitHub Bot committed 2024-09-12 19:17:23 -07:00
1 parent bb3ec4d6c3
commit 5e288d0cd4
1 file changed
+2 -2
@@ -53,11 +53,11 @@ public class CustomLineHeightSpan(height: Float) : LineHeightSpan, ReactSpan {
// Adjust fm.top and fm.bottom
fm.top += topReduction
fm.bottom += bottomReduction
fm.bottom -= bottomReduction
// If there's a remainder, put it on the top
val remainder = excess - (topReduction + bottomReduction)
fm.top += remainder
fm.top -= remainder
} else {
// Show proportionally additional ascent / top & descent / bottom
val additional = lineHeight - (-fm.top + fm.bottom)