hrev45845 adds 1 changeset to branch 'master' old head: 8b2fbc4fa0b6295ed6ebb2484018e42dc12d1cd0 new head: 8832917f2c44f719acff0909010f8e639e8838ab overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=8832917+%5E8b2fbc4 ---------------------------------------------------------------------------- 8832917: Debugger: SourceView: Fix several drawing bugs. - MarkerView: If the view was resized, and the newly revealed region was after the last source line, it wouldn't be redrawn properly. - TextView: Reset low color for painting the region after the source. Otherwise, if either the instruction pointer or a breakpoint were at the last line of the current source, the empty space after would be filled in that color rather than the background color. [ Rene Gollent <anevilyak@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev45845 Commit: 8832917f2c44f719acff0909010f8e639e8838ab URL: http://cgit.haiku-os.org/haiku/commit/?id=8832917 Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Thu Jul 11 11:35:06 2013 UTC ---------------------------------------------------------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) .../gui/team_window/SourceView.cpp | 66 ++++++++++---------- ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp b/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp index c9249d9..3e45272 100644 --- a/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp @@ -902,43 +902,42 @@ SourceView::MarkerView::Draw(BRect updateRect) // get the lines intersecting with the update rect int32 minLine, maxLine; GetLineRange(updateRect, minLine, maxLine); - if (minLine > maxLine) - return; - - // get the markers in that range - SourceView::MarkerManager::MarkerList markers; - fMarkerManager->GetMarkers(minLine, maxLine, markers); - - float width = Bounds().Width(); - - AutoLocker<SourceCode> sourceLocker(fSourceCode); + if (minLine <= maxLine) { + // get the markers in that range + SourceView::MarkerManager::MarkerList markers; + fMarkerManager->GetMarkers(minLine, maxLine, markers); + + float width = Bounds().Width(); + + AutoLocker<SourceCode> sourceLocker(fSourceCode); + + int32 markerIndex = 0; + for (int32 line = minLine; line <= maxLine; line++) { + bool drawBreakpointOptionMarker = true; + + SourceView::MarkerManager::Marker* marker; + FillRect(LineRect(line), B_SOLID_LOW); + while ((marker = markers.ItemAt(markerIndex)) != NULL + && marker->Line() == (uint32)line) { + marker->Draw(this, LineRect(line)); + drawBreakpointOptionMarker = false; + markerIndex++; + } - int32 markerIndex = 0; - for (int32 line = minLine; line <= maxLine; line++) { - bool drawBreakpointOptionMarker = true; - - SourceView::MarkerManager::Marker* marker; - FillRect(LineRect(line), B_SOLID_LOW); - while ((marker = markers.ItemAt(markerIndex)) != NULL - && marker->Line() == (uint32)line) { - marker->Draw(this, LineRect(line)); - drawBreakpointOptionMarker = false; - markerIndex++; - } + if (!drawBreakpointOptionMarker) + continue; - if (!drawBreakpointOptionMarker) - continue; + SourceLocation statementStart, statementEnd; + if (!fSourceCode->GetStatementLocationRange(SourceLocation(line), + statementStart, statementEnd) + || statementStart.Line() != line) { + continue; + } - SourceLocation statementStart, statementEnd; - if (!fSourceCode->GetStatementLocationRange(SourceLocation(line), - statementStart, statementEnd) - || statementStart.Line() != line) { - continue; + float y = ((float)line + 0.5f) * fFontInfo->lineHeight; + SetHighColor(fBreakpointOptionMarker); + FillEllipse(BPoint(width - 8, y), 2, 2); } - - float y = ((float)line + 0.5f) * fFontInfo->lineHeight; - SetHighColor(fBreakpointOptionMarker); - FillEllipse(BPoint(width - 8, y), 2, 2); } float y = (maxLine + 1) * fFontInfo->lineHeight; @@ -1154,6 +1153,7 @@ SourceView::TextView::Draw(BRect updateRect) y = (maxLine + 1) * fFontInfo->lineHeight; if (y < updateRect.bottom) { + SetLowColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR)); FillRect(BRect(0.0, y, Bounds().right, updateRect.bottom), B_SOLID_LOW); }