Skip to content

Commit

Permalink
fine tune scrolling
Browse files Browse the repository at this point in the history
Signed-off-by: isXander <isxander@users.noreply.github.com>
  • Loading branch information
isXander committed Jul 31, 2022
1 parent e5bff4f commit 5856e21
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@ plugins {

id("com.modrinth.minotaur") version "2.4.+"
id("me.hypherionmc.cursegradle") version "2.+"
id("com.github.breadmoirai.github-release") version "2.+"
id("com.github.breadmoirai.github-release") version "2.4.+"
`maven-publish`

id("io.github.p03w.machete") version "1.+"
id("io.github.p03w.machete") version "1.1.+"
}

group = "dev.isxander"
version = "2.0.0"

repositories {
mavenCentral()
maven("https://repo.sk1er.club/repository/maven-public")
maven("https://maven.isxander.dev/releases")
maven("https://maven.shedaniel.me/")
maven("https://maven.terraformersmc.com/releases")
maven("https://jitpack.io")
maven("https://maven.shedaniel.me/")
maven("https://maven.isxander.dev/releases")
}

val minecraftVersion: String by project
Expand Down
2 changes: 1 addition & 1 deletion changelogs/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
- When letting go of the zoom key or toggling zoom off whilst scrolled in,
the normal zoom out transition is used with the same amount of time as if you weren't scrolled.
- Increased number of scroll steps to 30.
- Apply quadratic function to scroll zoom steps to make the first few steps smaller
- Apply function to scroll zoom steps to make the first few steps smaller
and the last steps larger to create a more linear effect.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ minecraftVersion=1.19.1
loaderVersion=0.14.+
fabricVersion=0.58.5+1.19.1
fabricKotlinVersion=1.8.2
settxiVersion=2.5.2
settxiVersion=2.5.3

modrinthId=zoomify
curseforgeId=574741
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/dev/isxander/zoomify/ZoomHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ZoomHelper(private val starting: Double = 1.0) {

return (1/initialMultiplier + scrollDivisor).also {
if (initialInterpolation == 0.0 && scrollInterpolation == 0.0) resetting = false
if (!resetting) resetInterpolation = 1/it
if (!resetting) resetInterpolation = 1 / it
}
}

Expand All @@ -106,7 +106,7 @@ class ZoomHelper(private val starting: Double = 1.0) {
return MathHelper.lerp(
MathHelper.lerp(tickDelta.toDouble(), prevScrollInterpolation, scrollInterpolation),
0.0,
Zoomify.maxScrollTiers * (ZoomifySettings.scrollZoomAmount * 2.0)
Zoomify.maxScrollTiers * (ZoomifySettings.scrollZoomAmount * 3.0)
).let { if (resetting) 0.0 else it }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object ZoomifySettings : SettxiConfigKotlinx(FabricLoader.getInstance().configDi
category = SCROLLING
}

var scrollZoomAmount by int(2) {
var scrollZoomAmount by int(3) {
name = "zoomify.gui.scrollZoomAmount.name"
description = "zoomify.gui.scrollZoomAmount.description"
category = SCROLLING
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"fabric-language-kotlin": ">=1.8.2+kotlin.1.7.10",
"minecraft": "1.19.x",
"java": ">=17",
"cloth-config": "7.x.x",
"cloth-config": ["7.x.x", "8.x.x"],
"settxi-gui-cloth-config": "2.x.x"
},
"suggests": {
Expand Down

0 comments on commit 5856e21

Please sign in to comment.