Remove pointless vertical alignment logic

The only time it has an effect is when font substitution occurs, and the
end result tends to be worse than doing nothing at all.
This commit is contained in:
Thomas Goyne 2014-04-20 19:31:08 -07:00
parent e42e6f36e6
commit f14cef7321
1 changed files with 5 additions and 6 deletions

View File

@ -177,7 +177,7 @@ void BaseGrid::UpdateStyle() {
dc.SetFont(font);
// Set line height
lineHeight = dc.GetTextExtent("#TWFfgGhH").GetHeight() + 4;
lineHeight = dc.GetCharHeight() + 4;
// Set row brushes
row_colors.Default.SetColour(to_wx(OPT_GET("Colour/Subtitle Grid/Background/Background")->GetColor()));
@ -298,14 +298,13 @@ void BaseGrid::OnPaint(wxPaintEvent &) {
dc.SetPen(*wxTRANSPARENT_PEN);
auto paint_text = [&](wxString const& str, int x, int y, int col) {
wxSize ext = dc.GetTextExtent(str);
int top = y + (lineHeight - ext.GetHeight()) / 2;
int left = x + 4;
if (columns[col]->Centered())
if (columns[col]->Centered()) {
wxSize ext = dc.GetTextExtent(str);
left += (column_widths[col] - 6 - ext.GetWidth()) / 2;
}
dc.DrawText(str, left, top);
dc.DrawText(str, left, y + 2);
};
// Paint header