From 6fdf2dd2b3442767d465ceb817f597e5471519fa Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 4 Jul 2018 16:35:06 -0700 Subject: [PATCH] Tracker: center text horizontally again We alwasys draw text at the bottom of the calculated TextWidget rect, that's why it needed to be centered to get the desired placement. However, there is two places --- src/kits/tracker/TextWidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp index 661474707e..14b61556be 100644 --- a/src/kits/tracker/TextWidget.cpp +++ b/src/kits/tracker/TextWidget.cpp @@ -134,7 +134,8 @@ BTextWidget::ColumnRect(BPoint poseLoc, const BColumn* column, BRect result; result.left = column->Offset() + poseLoc.x; result.right = result.left + column->Width(); - result.bottom = poseLoc.y + view->ListElemHeight() - 1; + result.bottom = poseLoc.y + + roundf((view->ListElemHeight() + view->FontHeight()) / 2); result.top = result.bottom - view->FontHeight(); return result; } @@ -175,7 +176,8 @@ BTextWidget::CalcRectCommon(BPoint poseLoc, const BColumn* column, break; } - result.bottom = poseLoc.y + (view->ListElemHeight() - 1); + result.bottom = poseLoc.y + + roundf((view->ListElemHeight() + view->FontHeight()) / 2); } else { if (view->ViewMode() == kIconMode) { // large/scaled icon mode