Skip to content

Commit

Permalink
fix for bottom adjustment (facebook#46475)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#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
  • Loading branch information
mellyeliu authored and facebook-github-bot committed Sep 13, 2024
1 parent bb3ec4d commit 5e288d0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5e288d0

Please sign in to comment.