Skip to content

Commit

Permalink
Zoomable: reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroBrine1st committed Nov 11, 2023
1 parent f4abf49 commit 4017538
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/src/main/java/ru/herobrine1st/e621/ui/component/Zoomable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@ class VelocityTrackerDifferential {
}

fun calculateVelocityAsOffset(): Offset {
return Offset(xVelocityTracker.calculateVelocity(), yVelocityTracker.calculateVelocity())
return Offset(
xVelocityTracker.calculateVelocity(),
yVelocityTracker.calculateVelocity()
)
}

fun resetTracking() {
Expand All @@ -440,8 +443,12 @@ class VelocityTrackerDifferential {
fun rememberZoomableState(
@FloatRange(from = 1.0) maxScale: Float = MAX_SCALE_DEFAULT,
initialScale: Float = 1f,
initialTranslation: Offset = Offset.Zero
) = remember { ZoomableState(maxScale, initialScale, initialTranslation) }
initialTranslation: Offset = Offset.Zero,
zoomSteps: List<Float> = listOf(
1f,
sqrt(maxScale)
)
) = remember { ZoomableState(maxScale, initialScale, initialTranslation, zoomSteps) }


@Preview
Expand Down

0 comments on commit 4017538

Please sign in to comment.