Skip to content

Commit

Permalink
Fix incorrect Height in Text components
Browse files Browse the repository at this point in the history
Summary:
This diff fixes a bug in the calculation of layout for text components

The rootcause of the bug is that fabric is not taking into consideration height constraints as part of the cache for text measurments.
The title text was being measured with a specific height constraint (22px) at the begining of the render, later there was a re-measure for the same Text component with a different height constraint, but fabric was reusing the result of the first calculation instead of re-measuring the text.

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26676716

fbshipit-source-id: 3e769e0ca35b3e363b96d3a6d1626a091eaad908
  • Loading branch information
mdvacca authored and facebook-github-bot committed Feb 26, 2021
1 parent 7b814b4 commit b3cdf8c
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -190,7 +190,9 @@ inline bool operator==(
lhs.attributedString, rhs.attributedString) &&
lhs.paragraphAttributes == rhs.paragraphAttributes &&
lhs.layoutConstraints.maximumSize.width ==
rhs.layoutConstraints.maximumSize.width;
rhs.layoutConstraints.maximumSize.width &&
lhs.layoutConstraints.maximumSize.height ==
rhs.layoutConstraints.maximumSize.height;
}

inline bool operator!=(
Expand Down

0 comments on commit b3cdf8c

Please sign in to comment.