File tree Expand file tree Collapse file tree
image/src/main/java/com/smarttoolfactory/image/zoom Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,10 +206,7 @@ open class ZoomState internal constructor(
206206 gestureZoom : Float ,
207207 gestureRotate : Float = 1f,
208208 ) {
209- var zoom = zoom
210-
211- val boundPan = limitPan && ! rotationEnabled
212-
209+ val zoom = (zoom * gestureZoom).coerceIn(zoomMin, zoomMax)
213210 val rotation = if (rotationEnabled) {
214211 rotation + gestureRotate
215212 } else {
@@ -219,6 +216,7 @@ open class ZoomState internal constructor(
219216 if (panEnabled) {
220217 val offset = pan
221218 var newOffset = offset + gesturePan.times(zoom)
219+ val boundPan = limitPan && ! rotationEnabled
222220
223221 if (boundPan) {
224222 val maxX = (size.width * (zoom - 1 ) / 2f )
@@ -234,7 +232,6 @@ open class ZoomState internal constructor(
234232 }
235233
236234 if (zoomEnabled) {
237- zoom = (zoom * gestureZoom).coerceIn(zoomMin, zoomMax)
238235 snapZoomTo(zoom)
239236 }
240237
You can’t perform that action at this time.
0 commit comments