replacing min/max usage with kotlin's

This commit is contained in:
minjaesong
2023-07-11 01:54:46 +09:00
parent d96b7d1b84
commit 79f19120f2
66 changed files with 308 additions and 345 deletions

View File

@@ -8,6 +8,7 @@ import net.torvald.terrarum.Second
import net.torvald.terrarum.blendNormalStraightAlpha
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.ui.UICanvas
import kotlin.math.max
/**
* Created by minjaesong on 2016-01-23.
@@ -56,7 +57,7 @@ class Notification : UICanvas() {
App.fontGame.getWidth(message[0])
else
message.map { App.fontGame.getWidth(it) }.sorted().last()
val displayedTextWidth = maxOf(240, realTextWidth)
val displayedTextWidth = max(240, realTextWidth)
// force the UI to the centre of the screen
this.posX = (App.scr.width - displayedTextWidth) / 2