Skip to content

Commit

Permalink
Fix mising ANTI_ALIAS_FLAG when resetting Text Paint
Browse files Browse the repository at this point in the history
Summary:
D63303172 introduced a bug showing truncation on versions of Android <= 28. I tracked this down to `ANTI_ALIAS_FLAG` getting cleared when we reset the paint. This applies it again after resetting, for consistency with previous behavior, and TextView.

Changelog:
[Android][Fixed] - Fix mising `ANTI_ALIAS_FLAG` when resetting Text Paint

Differential Revision: D63930051
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Oct 5, 2024
1 parent 3f1e381 commit 1ee3add
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ private static void updateTextPaint(
// hypothetical height of a new line after a trailing newline charater (considered part of the
// previous line).
paint.reset();
paint.setFlags(TextPaint.ANTI_ALIAS_FLAG);
if (baseTextAttributes.getEffectiveFontSize() != ReactConstants.UNSET) {
paint.setTextSize(baseTextAttributes.getEffectiveFontSize());
}
Expand Down

0 comments on commit 1ee3add

Please sign in to comment.