Skip to content

Commit

Permalink
Fix measuring text with incorrect hyphenationFrequency
Browse files Browse the repository at this point in the history
Summary:
A typo means TextLayoutManager will incorrectly measure text as if `LineBreaker.HYPHENATION_FREQUENCY_NORMAL` is set, instead of the correct default of `LineBreaker.HYPHENATION_FREQUENCY_NONE` which we use to display the `TextView`. This causes truncation if hyphenation would have caused text to be shorter than if not hyphenated. Fix the typo.

Changelog: [Android][Fixed] - Fix measuring text with incorrect hyphenationFrequency

Reviewed By: mellyeliu

Differential Revision: D63293027

fbshipit-source-id: baaf2ae2676548cf0815ae96e324af273be6f99e
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Sep 24, 2024
1 parent 7ab0002 commit fc82240
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public static Layout createLayout(
? paragraphAttributes.getBoolean(PA_KEY_INCLUDE_FONT_PADDING)
: DEFAULT_INCLUDE_FONT_PADDING;
int hyphenationFrequency =
TextAttributeProps.getTextBreakStrategy(
TextAttributeProps.getHyphenationFrequency(
paragraphAttributes.getString(PA_KEY_HYPHENATION_FREQUENCY));
boolean adjustFontSizeToFit =
paragraphAttributes.contains(PA_KEY_ADJUST_FONT_SIZE_TO_FIT)
Expand Down

0 comments on commit fc82240

Please sign in to comment.