Cacao: Fix button not flooring offsets
This commit is contained in:
parent
d18b8a8a08
commit
e8455bdb2f
|
@ -8,6 +8,7 @@ import net.shadowfacts.cacao.util.RenderHelper
|
||||||
import net.shadowfacts.cacao.view.NinePatchView
|
import net.shadowfacts.cacao.view.NinePatchView
|
||||||
import net.shadowfacts.cacao.view.View
|
import net.shadowfacts.cacao.view.View
|
||||||
import net.shadowfacts.kiwidsl.dsl
|
import net.shadowfacts.kiwidsl.dsl
|
||||||
|
import kotlin.math.floor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract button class. Cannot be constructed directly, used for creating button implementations with their own
|
* An abstract button class. Cannot be constructed directly, used for creating button implementations with their own
|
||||||
|
@ -82,7 +83,7 @@ abstract class AbstractButton<Impl: AbstractButton<Impl>>(val content: View, val
|
||||||
|
|
||||||
override fun draw(matrixStack: MatrixStack, mouse: Point, delta: Float) {
|
override fun draw(matrixStack: MatrixStack, mouse: Point, delta: Float) {
|
||||||
RenderHelper.pushMatrix()
|
RenderHelper.pushMatrix()
|
||||||
RenderHelper.translate(frame.left, frame.top)
|
RenderHelper.translate(floor(frame.left), floor(frame.top))
|
||||||
|
|
||||||
RenderHelper.fill(matrixStack, bounds, backgroundColor)
|
RenderHelper.fill(matrixStack, bounds, backgroundColor)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue