From 9cad16b96e5eb9afd3db29f5b700572f53eeed33 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 5 Oct 2009 03:11:04 +0000 Subject: [PATCH] Fixed drawing of the marker line backgrounds. They were off by the font descent. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33432 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/gui/team_window/SourceView.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/debugger/gui/team_window/SourceView.cpp b/src/apps/debugger/gui/team_window/SourceView.cpp index 32aa2dc445..5087f2ea10 100644 --- a/src/apps/debugger/gui/team_window/SourceView.cpp +++ b/src/apps/debugger/gui/team_window/SourceView.cpp @@ -41,9 +41,8 @@ static const int32 kLeftTextMargin = 3; static const float kMinViewHeight = 80.0f; static const int32 kSpacesPerTab = 4; -static const bigtime_t kScrollTimer = 10000LL; - // TODO: Should be settable! +static const bigtime_t kScrollTimer = 10000LL; class SourceView::BaseView : public BView { @@ -1015,8 +1014,7 @@ SourceView::TextView::Draw(BRect updateRect) int32 markerIndex = 0; for (int32 i = minLine; i <= maxLine; i++) { SetLowColor(ViewColor()); - float y = (float)(i + 1) * fFontInfo->lineHeight - - fFontInfo->fontHeight.descent; + float y = i * fFontInfo->lineHeight; BString lineString; _FormatLine(fSourceCode->LineAt(i), lineString); @@ -1032,13 +1030,15 @@ SourceView::TextView::Draw(BRect updateRect) SetLowColor(96, 216, 216, 255); else SetLowColor(255, 255, 0, 255); - FillRect(BRect(kLeftTextMargin, y - fFontInfo->lineHeight, - Bounds().right, y), B_SOLID_LOW); + FillRect(BRect(kLeftTextMargin, y, Bounds().right, + y + fFontInfo->lineHeight), B_SOLID_LOW); break; } else break; } - DrawString(lineString, BPoint(kLeftTextMargin, y)); + + DrawString(lineString, + BPoint(kLeftTextMargin, y + fFontInfo->fontHeight.ascent)); } if (fSelectionStart.line != -1 && fSelectionEnd.line != -1) {