Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stretched image on after side #2

Open
Cutta opened this issue Oct 28, 2022 · 2 comments
Open

Stretched image on after side #2

Cutta opened this issue Oct 28, 2022 · 2 comments

Comments

@Cutta
Copy link

Cutta commented Oct 28, 2022

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

@SmartToolFactory
Copy link
Owner

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?

@Cutta
Copy link
Author

Cutta commented Nov 7, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants