Fix renderLayeredList updating current z layer wrong

This commit is contained in:
DBotThePony 2022-09-08 20:56:17 +07:00
parent 404c3dd6d1
commit bd5a6f3259
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -53,7 +53,7 @@ fun renderLayeredList(transform: Matrix4fStack, potentialRenderers: List<ILayere
var renderCalls = 0
while (lastBottom > 0 && renderers.isNotEmpty()) {
var newBottom = lastBottom
var newBottom = Int.MIN_VALUE
for (i in renderers.size - 1 downTo 0) {
val renderer = renderers[i]
@ -65,7 +65,7 @@ fun renderLayeredList(transform: Matrix4fStack, potentialRenderers: List<ILayere
if (newLevel <= -1) {
renderers.removeAt(i)
} else {
newBottom = newBottom.coerceAtMost(newLevel)
newBottom = newBottom.coerceAtLeast(newLevel)
}
}