File tree 1 file changed +3
-2
lines changed
transformations/src/main/java/com/commit451/coiltransformations
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import android.graphics.Canvas
5
5
import android.graphics.RectF
6
6
import androidx.core.graphics.createBitmap
7
7
import coil.size.Size
8
+ import coil.size.pxOrElse
8
9
import coil.transform.Transformation
9
10
import com.commit451.coiltransformations.Util.safeConfig
10
11
import kotlin.math.max
@@ -26,8 +27,8 @@ class CropTransformation(
26
27
override val cacheKey: String = " ${CropTransformation ::class .java.name} -$cropType "
27
28
28
29
override suspend fun transform (input : Bitmap , size : Size ): Bitmap {
29
- val width = input.width
30
- val height = input.height
30
+ val width = size.width.pxOrElse { input.width }
31
+ val height = size.height.pxOrElse { input.height }
31
32
32
33
val output = createBitmap(width, height, input.safeConfig)
33
34
You can’t perform that action at this time.
0 commit comments