mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 05:09:25 +07:00
Avoid overflow of the construction bar (#3573)
This commit is contained in:
@ -316,7 +316,9 @@ object ImageGetter {
|
|||||||
|
|
||||||
fun getProgressBarVertical(width: Float, height: Float, percentComplete: Float, progressColor: Color, backgroundColor: Color): Table {
|
fun getProgressBarVertical(width: Float, height: Float, percentComplete: Float, progressColor: Color, backgroundColor: Color): Table {
|
||||||
val advancementGroup = Table()
|
val advancementGroup = Table()
|
||||||
val completionHeight = height * percentComplete
|
var completionHeight = height * percentComplete
|
||||||
|
if (completionHeight > height)
|
||||||
|
completionHeight = height
|
||||||
advancementGroup.add(getImage(whiteDotLocation).apply { color = backgroundColor })
|
advancementGroup.add(getImage(whiteDotLocation).apply { color = backgroundColor })
|
||||||
.size(width, height - completionHeight).row()
|
.size(width, height - completionHeight).row()
|
||||||
advancementGroup.add(getImage(whiteDotLocation).apply { color = progressColor }).size(width, completionHeight)
|
advancementGroup.add(getImage(whiteDotLocation).apply { color = progressColor }).size(width, completionHeight)
|
||||||
|
Reference in New Issue
Block a user