Skip to content

Commit

Permalink
Enable clipbounds of TextSpec by default
Browse files Browse the repository at this point in the history
Summary: To have a deterministic behavior of automatic bounds animation we need to clip drawables by their bounds. Recently we added an optional clipping of `TextDrawable` by bounds which is passed to drawable via `Text` component prop which was not clipped by default. This diff turns that default flag to `true`.

Reviewed By: marco-cova

Differential Revision: D6987841

fbshipit-source-id: d5e757d3f344df1d1bf5fcf6c0ae9ab7ac38108d
  • Loading branch information
muraziz authored and facebook-github-bot committed Feb 19, 2018
1 parent 99ff699 commit cf49da2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
* bounds user can click to be able to trigger ClickableSpan's click action. This could be
* useful in a densely lined text with links like 'Continue reading ...' in NewsFeed to be able
* to click that easily.
* @prop clipToBounds If the text should be clipped inside component bounds. Default: {@code false}
* @prop clipToBounds If the text should be clipped inside component bounds. Default: {@code true}
*/
@MountSpec(
isPureRender = true,
Expand Down Expand Up @@ -166,7 +166,7 @@ class TextSpec {
@PropDefault protected static final int hyphenationFrequency = DEFAULT_HYPHENATION_FREQUENCY;
@PropDefault protected static final int highlightStartOffset = -1;
@PropDefault protected static final int highlightEndOffset = -1;
@PropDefault protected static final boolean clipToBounds = false;
@PropDefault protected static final boolean clipToBounds = true;

private static final Path sTempPath = new Path();
private static final Rect sTempRect = new Rect();
Expand Down

0 comments on commit cf49da2

Please sign in to comment.