Skip to content

Stretched image on after side #2

Open

Description

@Cutta

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

Activity

  1. SmartToolFactory commented on Nov 5, 2022

    @SmartToolFactory
    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?

  2. Cutta commented on Nov 7, 2022

    @Cutta
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions