Change: Use CenterBounds function in more places.

CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
This commit is contained in:
Peter Nelson
2022-09-07 08:31:02 +01:00
committed by PeterN
parent 18201dfbc3
commit eb4ba1991b
14 changed files with 23 additions and 26 deletions

View File

@@ -488,7 +488,7 @@ public:
int cg_ofst = HasBit(this->cargo_filter, cs->Index()) ? 1 : 0;
GfxFillRect(r.left + cg_ofst + 1, r.top + cg_ofst + 1, r.right - 1 + cg_ofst, r.bottom - 1 + cg_ofst, cs->rating_colour);
TextColour tc = GetContrastColour(cs->rating_colour);
DrawString(r.left + cg_ofst, r.right + cg_ofst, r.top + (r.bottom - r.top - FONT_HEIGHT_SMALL) / 2 + cg_ofst, cs->abbrev, tc, SA_HOR_CENTER);
DrawString(r.left + cg_ofst, r.right + cg_ofst, CenterBounds(r.top, r.bottom, FONT_HEIGHT_SMALL) + cg_ofst, cs->abbrev, tc, SA_HOR_CENTER);
}
break;
}