Skip to content

Commit 4469952

Browse files
Pass drawable width and height in pixels for inline image
Reviewed By: achen1 Differential Revision: D7655775 fbshipit-source-id: 32887eb5a686ccc45f50fb334248aad6889f704a
1 parent 7c5d581 commit 4469952

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import android.graphics.Color;
1111
import android.graphics.PorterDuff;
12+
import com.facebook.react.uimanager.PixelUtil;
1213
import javax.annotation.Nullable;
1314

1415
import android.content.res.Resources;
@@ -70,12 +71,12 @@ public FrescoBasedReactTextInlineImageSpan(
7071
);
7172
mDraweeControllerBuilder = draweeControllerBuilder;
7273
mCallerContext = callerContext;
73-
74-
mHeight = height;
7574
mTintColor = tintColor;
76-
mWidth = width;
7775
mUri = (uri != null) ? uri : Uri.EMPTY;
7876
mHeaders = headers;
77+
mWidth = (int)(PixelUtil.toPixelFromDIP(width));
78+
mHeight = (int)(PixelUtil.toPixelFromDIP(height));
79+
7980
}
8081

8182
/**

0 commit comments

Comments
 (0)