Skip to content

Commit 53100ec

Browse files
plamenkofacebook-github-bot-3
authored andcommitted
Add support for custom scale types
Summary: public This diff adds support for providing custom scaletypes to Drawee. The implementation for the preexisting scale types is preserved. Breaking changes should be minimal. In fact, only direct usages of `ScalingUtils.getTransform(..., scaleType)` should be converted to `scaleType.getTransform(...)`. Reviewed By: kirwan Differential Revision: D2862911 fb-gh-sync-id: ab0355fd13544dc08ce4481eda87287404ea7adb
1 parent 1dd5ba7 commit 53100ec

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,15 @@ public class ReactImageView extends GenericDraweeView {
7474
private class RoundedCornerPostprocessor extends BasePostprocessor {
7575

7676
float getRadius(Bitmap source) {
77-
ScalingUtils.getTransform(
78-
sMatrix,
79-
new Rect(0, 0, source.getWidth(), source.getHeight()),
80-
source.getWidth(),
81-
source.getHeight(),
82-
0.0f,
83-
0.0f,
84-
mScaleType);
85-
sMatrix.invert(sInverse);
86-
return sInverse.mapRadius(mBorderRadius);
77+
mScaleType.getTransform(
78+
sMatrix,
79+
new Rect(0, 0, source.getWidth(), source.getHeight()),
80+
source.getWidth(),
81+
source.getHeight(),
82+
0.0f,
83+
0.0f);
84+
sMatrix.invert(sInverse);
85+
return sInverse.mapRadius(mBorderRadius);
8786
}
8887

8988
@Override

0 commit comments

Comments
 (0)