fix: some NaNs that can be caused by scroll bars

This commit is contained in:
minjaesong
2025-02-01 20:51:40 +09:00
parent a2006b0354
commit 69ebdbc542
13 changed files with 19 additions and 18 deletions

View File

@@ -249,7 +249,7 @@ class UIDebugInventron : UICanvas(
}
private fun drawAnalysis(batch: SpriteBatch) {
val scroll = (analyserScroll.value * analysisTextBuffer.size.times(TEXT_LINE_HEIGHT).minus(analyserHeight - 3)).roundToInt().coerceAtLeast(0)
val scroll = (analyserScroll.value * analysisTextBuffer.size.times(TEXT_LINE_HEIGHT).minus(analyserHeight - 3)).ifNaN(0.0).roundToInt().coerceAtLeast(0)
analysisTextBuffer.forEachIndexed { index, s ->
App.fontGame.draw(batch, s, analyserPosX + 6, analyserPosY2 + 3 + index * TEXT_LINE_HEIGHT - scroll)
}