Skip to content

Commit 7e1806b

Browse files
remove coroutineScope from ZoomState functions
1 parent b423228 commit 7e1806b

File tree

1 file changed

+7
-7
lines changed
  • image/src/main/java/com/smarttoolfactory/image/zoom

1 file changed

+7
-7
lines changed

image/src/main/java/com/smarttoolfactory/image/zoom/ZoomState.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ open class ZoomState internal constructor(
196196
rotation = animatableRotation.value
197197
)
198198

199-
open fun boundPan(lowerBound: Offset?, upperBound: Offset?) {
199+
open fun updateBounds(lowerBound: Offset?, upperBound: Offset?) {
200200
animatablePan.updateBounds(lowerBound, upperBound)
201201
}
202202

@@ -247,37 +247,37 @@ open class ZoomState internal constructor(
247247
launch { animateRotationTo(rotation) }
248248
}
249249

250-
internal suspend fun animatePanTo(pan: Offset) = coroutineScope {
250+
internal suspend fun animatePanTo(pan: Offset) {
251251
if (panEnabled) {
252252
animatablePan.animateTo(pan)
253253
}
254254
}
255255

256-
internal suspend fun animateZoomTo(zoom: Float) = coroutineScope {
256+
internal suspend fun animateZoomTo(zoom: Float) {
257257
if (zoomEnabled) {
258258
animatableZoom.animateTo(zoom)
259259
}
260260
}
261261

262-
internal suspend fun animateRotationTo(rotation: Float) = coroutineScope {
262+
internal suspend fun animateRotationTo(rotation: Float) {
263263
if (rotationEnabled) {
264264
animatableRotation.animateTo(rotation)
265265
}
266266
}
267267

268-
internal suspend fun snapPanTo(offset: Offset) = coroutineScope {
268+
internal suspend fun snapPanTo(offset: Offset) {
269269
if (panEnabled) {
270270
animatablePan.snapTo(offset)
271271
}
272272
}
273273

274-
internal suspend fun snapZoomTo(zoom: Float) = coroutineScope {
274+
internal suspend fun snapZoomTo(zoom: Float) {
275275
if (zoomEnabled) {
276276
animatableZoom.snapTo(zoom)
277277
}
278278
}
279279

280-
internal suspend fun snapRotationTo(rotation: Float) = coroutineScope {
280+
internal suspend fun snapRotationTo(rotation: Float) {
281281
if (rotationEnabled) {
282282
animatableRotation.snapTo(rotation)
283283
}

0 commit comments

Comments
 (0)