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
This commit is contained in:
parent
1dd5ba7021
commit
53100ecccb
|
@ -74,16 +74,15 @@ public class ReactImageView extends GenericDraweeView {
|
|||
private class RoundedCornerPostprocessor extends BasePostprocessor {
|
||||
|
||||
float getRadius(Bitmap source) {
|
||||
ScalingUtils.getTransform(
|
||||
sMatrix,
|
||||
new Rect(0, 0, source.getWidth(), source.getHeight()),
|
||||
source.getWidth(),
|
||||
source.getHeight(),
|
||||
0.0f,
|
||||
0.0f,
|
||||
mScaleType);
|
||||
sMatrix.invert(sInverse);
|
||||
return sInverse.mapRadius(mBorderRadius);
|
||||
mScaleType.getTransform(
|
||||
sMatrix,
|
||||
new Rect(0, 0, source.getWidth(), source.getHeight()),
|
||||
source.getWidth(),
|
||||
source.getHeight(),
|
||||
0.0f,
|
||||
0.0f);
|
||||
sMatrix.invert(sInverse);
|
||||
return sInverse.mapRadius(mBorderRadius);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue