1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

fix padding

This commit is contained in:
Chuo-Yun Yang 2019-03-04 20:25:32 -05:00
parent 1699ec0010
commit 951fed29bd

View File

@ -108,18 +108,20 @@ func (widget *Widget) nbascore() {
} }
vNum, _ := strconv.Atoi(vScore) vNum, _ := strconv.Atoi(vScore)
hNum, _ := strconv.Atoi(hScore) hNum, _ := strconv.Atoi(hScore)
hColor := ""
if quarter != 0 { // Compare the score if quarter != 0 { // Compare the score
if vNum > hNum { if vNum > hNum {
vTeam = "[orange]" + vTeam vTeam = "[orange]" + vTeam
} else if hNum > vNum { } else if hNum > vNum {
hScore = "[orange]" + hScore // hScore = "[orange]" + hScore
hColor = "[orange]" // For correct padding
hTeam = hTeam + "[white]" hTeam = hTeam + "[white]"
} else { } else {
vTeam = "[orange]" + vTeam vTeam = "[orange]" + vTeam
hTeam = hTeam + "[white]" hTeam = hTeam + "[white]"
} }
} }
allGame += fmt.Sprintf("%5s%v %s %3s [white]vs %-3s %s\n", "Q", quarter, vTeam, vScore, hScore, hTeam) // Format the score and store in allgame allGame += fmt.Sprintf("%5s%v %s %3s [white]vs %s%-3s %s\n", "Q", quarter, vTeam, vScore, hColor, hScore, hTeam) // Format the score and store in allgame
} }
widget.View.SetText(allGame) widget.View.SetText(allGame)