From 619b4ef49e8a97186d67c86a9b652eae87c36a89 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 23:12:14 +0000 Subject: [PATCH 1/4] Initial plan From f08b4e66a1a2e66d8ee4696bb7c6c2365b1983dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 23:16:35 +0000 Subject: [PATCH 2/4] Fix linearLikeSteps algorithm with proper logarithmic scaling Co-authored-by: isXander <43245524+isXander@users.noreply.github.com> --- .../kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt index 9a1ed6f..1858873 100644 --- a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt +++ b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt @@ -53,9 +53,13 @@ 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 logarithmic scaling to make each zoom step feel equally significant + // Maps linear input (0 to 1) to exponential output using natural logarithm + // This ensures each scroll step represents a constant multiplicative change in zoom + if (targetZoom > 0.0) { + val base = 10.0 // Base for exponential growth + targetZoom = (base.pow(targetZoom) - 1.0) / (base - 1.0) + } } prevScrollInterpolation = scrollInterpolation From 98a6f4e79afb3671a3417038830c5932e94ba306 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 23:17:42 +0000 Subject: [PATCH 3/4] Adjust exponential base to 4.0 for better zoom distribution Co-authored-by: isXander <43245524+isXander@users.noreply.github.com> --- src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt index 1858873..5ef97fa 100644 --- a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt +++ b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt @@ -54,10 +54,10 @@ class ZoomHelper( else 0.0 if (linearLikeSteps()) { // Use logarithmic scaling to make each zoom step feel equally significant - // Maps linear input (0 to 1) to exponential output using natural logarithm + // 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) { - val base = 10.0 // Base for exponential growth + val base = 4.0 // Base for exponential growth (balances early vs late zoom steps) targetZoom = (base.pow(targetZoom) - 1.0) / (base - 1.0) } } From 8b17708c93b1ef03649bf84daf36494aa443842c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 23:18:44 +0000 Subject: [PATCH 4/4] Address code review: improve documentation and comments Co-authored-by: isXander <43245524+isXander@users.noreply.github.com> --- src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt index 5ef97fa..818c364 100644 --- a/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt +++ b/src/main/kotlin/dev/isxander/zoomify/zoom/ZoomHelper.kt @@ -53,11 +53,15 @@ class ZoomHelper( scrollTiers.toDouble() / Zoomify.maxScrollTiers else 0.0 if (linearLikeSteps()) { - // Use logarithmic scaling to make each zoom step feel equally significant + // 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) { - val base = 4.0 // Base for exponential growth (balances early vs late zoom steps) + // 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) } }