Compose-Image icon indicating copy to clipboard operation
Compose-Image copied to clipboard

Stretched image on after side

Open Cutta opened this issue 3 years ago β€’ 2 comments

Hi, I am using the BeforeAfter image in my project. I came across a bug. It is reproducible. The after image stretched on my test phone. My phone is: Samsung Galaxy A5 Android: 8.0.0

streetch

Cutta avatar Oct 28 '22 08:10 Cutta

Hi CΓΌneyt. I don't have the device you experience the issue. Would you mind sending or debugging

drawImage(
    beforeImage,
    srcSize = IntSize(bitmapWidth, bitmapHeight),
    srcOffset = IntOffset(srcOffsetX, 0),
    dstSize = IntSize(width, height),
    dstOffset = IntOffset(dstOffsetX, 0),
    alpha = alpha,
    colorFilter = colorFilter,
    filterQuality = filterQuality
)

dstSize, dstOffset, and Canvas size might be leading to incorrect calculations?

SmartToolFactory avatar Nov 05 '22 15:11 SmartToolFactory

Hi again, thank you for replying. The variable values are like that for my case. bitmapWidth = 1224 bitmapHeight = 1632

canvasWidth = 756.0 canvasHeight = 1008.0

srcOffsetX = 612 dstOffsetX = 378

srcOffset = 612,0 dstSize = 756x1008 dstOffset = 378,0

Cutta avatar Nov 07 '22 15:11 Cutta