File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
transformations/src/main/java/com/commit451/coiltransformations Expand file tree Collapse file tree 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
55import android.graphics.RectF
66import androidx.core.graphics.createBitmap
77import coil.size.Size
8+ import coil.size.pxOrElse
89import coil.transform.Transformation
910import com.commit451.coiltransformations.Util.safeConfig
1011import kotlin.math.max
@@ -26,8 +27,8 @@ class CropTransformation(
2627 override val cacheKey: String = " ${CropTransformation ::class .java.name} -$cropType "
2728
2829 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 }
3132
3233 val output = createBitmap(width, height, input.safeConfig)
3334
You can’t perform that action at this time.
0 commit comments