diff --git a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt index 9a1ed6f..818c364 100644 --- a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt +++ b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt @@ -53,9 +53,17 @@ class ZoomHelper( scrollTiers.toDouble() / Zoomify.maxScrollTiers else 0.0 if (linearLikeSteps()) { - val curvature = 0.3 - val exp = 1 / (1 - curvature) - targetZoom = 2 * (targetZoom.pow(exp) / (targetZoom.pow(exp) + (2 - targetZoom).pow(exp))) + // Use exponential scaling to make each zoom step feel equally significant + // Maps linear input (0 to 1) to exponential output + // This ensures each scroll step represents a constant multiplicative change in zoom + if (targetZoom > 0.0) { + // Base of 4.0 chosen empirically: + // - Provides good balance between early and late zoom steps + // - At 50% scroll: ~33% of max zoom (reasonable middle ground) + // - Creates perceptually linear zoom progression + val base = 4.0 + targetZoom = (base.pow(targetZoom) - 1.0) / (base - 1.0) + } } prevScrollInterpolation = scrollInterpolation