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