fix: some NaNs that can be caused by scroll bars

This commit is contained in:
minjaesong
2025-02-01 20:51:40 +09:00
parent a2006b0354
commit 69ebdbc542
13 changed files with 19 additions and 18 deletions

View File

@@ -42,9 +42,9 @@ class UIItemHorzSlider(
// reset the scroll status
handlePos = 0.0
this.value = 0.0
field = value
field = value.coerceIn(12, width)
handleTravelDist = width - value
handleTravelDist = width - field
}
override val height = 24

View File

@@ -35,9 +35,9 @@ class UIItemVertSlider(
// reset the scroll status
handlePos = 0.0
this.value = 0.0
field = value
field = value.coerceIn(12, height)
handleTravelDist = height - value
handleTravelDist = height - field
}
companion object {