Shape radius different with RoundedCornersTransformation size #1289
Replies: 3 comments 1 reply
-
@anthony3637 did you find the solution? |
Beta Was this translation helpful? Give feedback.
-
I'm moving from Glide to Coil and I saw this strange behavior too. In my case, I'm using 12f of Radius and the result is different between the libraries. Since I saw some division by two on the RoundedCornersTransformation code, I tried to multiply my 12f radius by 2 and voilà: same result as Glide. So the RoundedCornersTransformation is doing some wrong math. |
Beta Was this translation helpful? Give feedback.
-
Hmm looks like Glide uses |
Beta Was this translation helpful? Give feedback.
-
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
`
`
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
Beta Was this translation helpful? Give feedback.
All reactions