diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/ColorPicker.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/ColorPicker.kt index 76568231c..26317bdb7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/ColorPicker.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/ColorPicker.kt @@ -25,6 +25,7 @@ import ru.dbotthepony.mc.otm.core.ResourceLocation import java.util.function.Consumer import java.util.function.Supplier import kotlin.math.roundToInt +import kotlin.math.sign open class ColorBoxPanel( screen: S, @@ -203,6 +204,11 @@ abstract class AbstractColorWangPanel( return super.mouseReleasedInner(x, y, button) } + override fun mouseScrolledInner(x: Double, y: Double, scroll: Double): Boolean { + onWangInput((wangPosition + sign(scroll.toFloat()) * (1f / 255f)).coerceIn(0f, 1f)) + return true + } + protected fun renderGradients(graphics: MGUIGraphics, mouseX: Float, mouseY: Float, partialTick: Float) { ColorBoxPanel.GRADIENT_RIGHT.render(graphics, 0f, 0f, width, height, color = rightColor) ColorBoxPanel.GRADIENT_LEFT.render(graphics, 0f, 0f, width, height, color = leftColor)