From 06a4c38e3ab5f33cb2dd9eaf21d86eadb4734082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 21 Feb 2014 09:38:20 +0100 Subject: [PATCH] Tracker: Don't offset text in selection box Either the offset was a workaround for some BeOS bug or backwards compatibility (I know of at least a vertical off-by-one text positioning on BeOS for backwards compatibility reasons), or the Haiku (FreeType) text rendering simply differs slightly, which can't be avoided. In any case, relevant here is what looks better. Should fix #1319. --- src/kits/tracker/TextWidget.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp index 8a63e86181..71097b44a0 100644 --- a/src/kits/tracker/TextWidget.cpp +++ b/src/kits/tracker/TextWidget.cpp @@ -509,17 +509,10 @@ BTextWidget::Draw(BRect eraseRect, BRect textRect, float, BPoseView* view, textRect.OffsetBy(offset); if (direct) { -#ifdef __HAIKU__ // draw selection box if selected if (selected) { -#else - // erase area we're going to draw in - // NOTE: WidgetTextOutline() is reused for - // erasing background on R5 here - if (view->WidgetTextOutline() || selected) { -#endif drawView->SetDrawingMode(B_OP_COPY); - eraseRect.OffsetBy(offset); +// eraseRect.OffsetBy(offset); // drawView->FillRect(eraseRect, B_SOLID_LOW); drawView->FillRect(textRect, B_SOLID_LOW); } else @@ -547,11 +540,10 @@ BTextWidget::Draw(BRect eraseRect, BRect textRect, float, BPoseView* view, BPoint loc; loc.y = textRect.bottom - view->FontInfo().descent; - loc.x = textRect.left + 1; + loc.x = textRect.left; const char* fittingText = fText->FittingText(view); -#ifdef __HAIKU__ // TODO: Comparing view and drawView here to avoid rendering // the text outline when producing a drag bitmap. The check is // not fully correct, since an offscreen view is also used in some @@ -611,12 +603,11 @@ BTextWidget::Draw(BRect eraseRect, BRect textRect, float, BPoseView* view, drawView->SetDrawingMode(B_OP_OVER); drawView->SetHighColor(textColor); } -#endif // __HAIKU__ drawView->DrawString(fittingText, loc); if (fSymLink && (fAttrHash == view->FirstColumn()->AttrHash())) { - // ToDo: + // TODO: // this should be exported to the WidgetAttribute class, probably // by having a per widget kind style if (direct) {