zeozeozeo / microui-go

A tiny, portable, immediate-mode UI library ported to idiomatic Go
https://zeozeozeo.github.io/ebitengine-microui-go/demo
The Unlicense
25 stars 5 forks source link

`SliderEx`'s step doesn't work correctly #3

Closed hajimehoshi closed 1 week ago

hajimehoshi commented 2 weeks ago

https://github.com/zeozeozeo/microui-go/blob/f386f91fa9b00aaccf6c292c891c30b1d3e5d905/controls.go#L268

Now any step values doesn't have any effects. This should be

v = math.Round(v/step) * step

This was reported by @galsjel at the Ebitengine Discord server.

hajimehoshi commented 2 weeks ago

https://github.com/rxi/microui/commit/8fe5267fc5d5b4fd925fb8822c2f08e362192be9

Actually the latest microui has a similar fix. This casts a float value to an integer value, which should be the same as math.Floor or math.Ceil. (This was found by @Zyko0 )