File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/main/kotlin/com/lambda/config/settings/numeric Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import com.lambda.config.settings.NumericSetting
2626import com.lambda.gui.dsl.ImGuiBuilder
2727import com.lambda.util.extension.CommandBuilder
2828import net.minecraft.command.CommandRegistryAccess
29+ import kotlin.math.roundToInt
2930
3031/* *
3132 * @see [com.lambda.config.Configurable]
@@ -47,7 +48,7 @@ class DoubleSetting(
4748 visibility
4849) {
4950 private var valueIndex: Int
50- get() = ((value - range.start) / step).toInt ()
51+ get() = ((value - range.start) / step).roundToInt ()
5152 set(index) {
5253 value = (range.start + index * step).coerceIn(range)
5354 }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import com.lambda.config.settings.NumericSetting
2525import com.lambda.gui.dsl.ImGuiBuilder
2626import com.lambda.util.extension.CommandBuilder
2727import net.minecraft.command.CommandRegistryAccess
28+ import kotlin.math.roundToInt
2829
2930/* *
3031 * @see [com.lambda.config.Configurable]
@@ -46,7 +47,7 @@ class FloatSetting(
4647 visibility
4748) {
4849 private var valueIndex: Int
49- get() = ((value - range.start) / step).toInt ()
50+ get() = ((value - range.start) / step).roundToInt ()
5051 set(index) {
5152 value = (range.start + index * step).coerceIn(range)
5253 }
You can’t perform that action at this time.
0 commit comments