Avoid overflow of the construction bar (#3573)

This commit is contained in:
GGGuenni
2021-02-04 15:22:05 +01:00
committed by GitHub
parent 72b917ca1f
commit 9d109d4e05

View File

@ -316,7 +316,9 @@ object ImageGetter {
fun getProgressBarVertical(width: Float, height: Float, percentComplete: Float, progressColor: Color, backgroundColor: Color): Table {
val advancementGroup = Table()
val completionHeight = height * percentComplete
var completionHeight = height * percentComplete
if (completionHeight > height)
completionHeight = height
advancementGroup.add(getImage(whiteDotLocation).apply { color = backgroundColor })
.size(width, height - completionHeight).row()
advancementGroup.add(getImage(whiteDotLocation).apply { color = progressColor }).size(width, completionHeight)