Compose-Zoom
Compose-Zoom copied to clipboard
🚀🏞🔍 Zoom Modifiers, zoomable image and layouts with limit pan bounds, fling and moving back to valid bounds and callbacks that return current transformation or visible image section
Fatal Exception: java.lang.RuntimeException: Canvas: trying to draw too large(256576512bytes) bitmap. at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:281) at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:91) at androidx.compose.ui.graphics.AndroidCanvas.drawImageRect-HPBpro0(AndroidCanvas.android.kt:271) at androidx.compose.ui.graphics.drawscope.CanvasDrawScope.drawImage-AZ2fEMs(CanvasDrawScope.kt:263) at androidx.compose.ui.node.LayoutNodeDrawScope.drawImage-AZ2fEMs(LayoutNodeDrawScope.kt:35) at androidx.compose.ui.graphics.drawscope.DrawScope.drawImage-AZ2fEMs$default(DrawScope.java:510) at androidx.compose.ui.graphics.drawscope.DrawScope$-CC.drawImage-AZ2fEMs$default(DrawScope.kt:130) at com.smarttoolfactory.zoom.ImageWithConstraintsKt$ImageImpl$1.invoke(ImageWithConstraints.kt:219) at com.smarttoolfactory.zoom.ImageWithConstraintsKt$ImageImpl$1.invoke(ImageWithConstraints.kt:205) at androidx.compose.ui.draw.DrawBackgroundModifier.draw(DrawModifier.kt:104)...
Calculate, pan and zoom to smallest possible rectangle so rotated Composable/Image can be moved. Currently move to bounds(EnhancedZoom/AnimatedZoom) works for Composables that are not rotated or rotates back to initial...
Update zooming algorithm to have a stationary zoom position to have more natural zooming