mirror of
https://github.com/wasabeef/glide-transformations.git
synced 2025-06-08 07:24:05 +08:00
refactor
This commit is contained in:
parent
e9d2c6d209
commit
decd2e58d5
@ -53,12 +53,8 @@ public class CropTransformation implements Transformation<Bitmap> {
|
||||
@Override
|
||||
public Resource<Bitmap> transform(Resource<Bitmap> resource, int outWidth, int outHeight) {
|
||||
Bitmap source = resource.get();
|
||||
if (mWidth == 0) {
|
||||
mWidth = source.getWidth();
|
||||
}
|
||||
if (mHeight == 0) {
|
||||
mHeight = source.getHeight();
|
||||
}
|
||||
mWidth = mWidth == 0 ? source.getWidth() : mWidth;
|
||||
mHeight = mHeight == 0 ? source.getHeight() : mHeight;
|
||||
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
|
Loading…
x
Reference in New Issue
Block a user