From cf49da23a8247cabd164e43325308489a6ab295d Mon Sep 17 00:00:00 2001 From: Aziz Murtazaev Date: Mon, 19 Feb 2018 13:32:16 -0800 Subject: [PATCH] Enable clipbounds of TextSpec by default 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 --- .../src/main/java/com/facebook/litho/widget/TextSpec.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litho-widget/src/main/java/com/facebook/litho/widget/TextSpec.java b/litho-widget/src/main/java/com/facebook/litho/widget/TextSpec.java index 2adca14cfb4..826e6f3c06a 100644 --- a/litho-widget/src/main/java/com/facebook/litho/widget/TextSpec.java +++ b/litho-widget/src/main/java/com/facebook/litho/widget/TextSpec.java @@ -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, @@ -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();