Fix clip preview crop
This commit is contained in:
1 parent
7742b2c570
commit
ecd39f5435
1 file changed
+6
-1
@@ -70,7 +70,12 @@ fun EhAsyncPreview(
|
||||
onState = {
|
||||
if (it is AsyncImagePainter.State.Success) {
|
||||
it.result.drawable.run {
|
||||
if ((intrinsicWidth.toFloat() / intrinsicHeight) in 0.5..0.8 && model.offsetX == Int.MIN_VALUE) {
|
||||
if (intrinsicWidth.toFloat() / intrinsicHeight in 0.5..0.8) {
|
||||
if (contentScale == ContentScale.Fit) contentScale = ContentScale.Crop
|
||||
}
|
||||
}
|
||||
model.run {
|
||||
if (clipWidth.toFloat() / clipHeight in 0.5..0.8) {
|
||||
if (contentScale == ContentScale.Fit) contentScale = ContentScale.Crop
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user