mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
fix: some NaNs that can be caused by scroll bars
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user