zoomimage icon indicating copy to clipboard operation
zoomimage copied to clipboard

Image not aligned after orientation change

Open IacobIonut01 opened this issue 6 months ago • 15 comments

Describe the bug

The Image is not longer aligned to Center (for example) after an orientation change (rotate the phone) - however, it returns to the default Top-Start. After re-opening the page on the new orientation, the image loads fine, however, if it rotates again, moves back to the Top-Start alignment

Affected platforms

  • Android

Affected components

Select of the components below:

  • SketchAsyncZoomImage

Versions

  • zoomimage version*: 1.1.0-alpha05
  • Kotlin version*: 2.0.0
  • Compose version(s)* (Jetpack): 2024.06.00

Running Devices

  • Pixel 6; Android 15; arm64
  • Pixel 7; Android 14; arm64

Sample code

    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        SketchZoomAsyncImage(
            modifier = Modifier.fillMaxSize(),
            uri = media.uri.toString(),
            contentScale = ContentScale.Fit,
            contentDescription = null
        )
    }

Reproduction steps

  • Create Compose Screen with given snippet
  • Set an uri
  • Open the app and observe the image being correctly displayed
  • Rotate the phone screen to landscase
  • Observe the image being aligned to the Top-Start instead
  • Rotate again to portrait and observe the image staying to Top-Start

Expected behavior

  • Create Compose Screen with given snippet
  • Set an uri
  • Open the app and observe the image being correctly displayed
  • Rotate the phone screen to landscase
  • Observe the image being correctly displayed
  • Rotate again to portrait and observe the image being correctly displayed

Screenshots

Screenshot_20240813_221546 Screenshot_20240813_221559 Screenshot_20240813_221610

Additional context

None.

Thanks for creating this library, completely full-fills my use-cases, but there's this small thing that delays me to release the version with your library instead of coil and telephoto

IacobIonut01 avatar Aug 13 '24 19:08 IacobIonut01