coil-kt / coil

Image loading for Android and Compose Multiplatform.

Home Page:https://coil-kt.github.io/coil/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shape radius different with RoundedCornersTransformation size

anthony3637 opened this issue · comments

Describe the bug
1: we used the shape file to view's background
2: we used coil's RoundedCornersTransformation

but radius size difference, how to resolve it

shape.xml
`

<solid android:color="#22229900"/>
<corners android:radius="50dp"/>

`

activity xml:
![image](https://user-images.githubusercontent.com/4946107/170238402-3aa75c0e-3acd-49bb-ad7d-e9aaaee2324e.png)

activity code:
val current = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50f, resources.displayMetrics) binding.img.load("xxx.jpg"){ transformations(RoundedCornersTransformation(current)) }

finally, we found different radius

Please ask usage questions in GitHub discussions.