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.
This commit is contained in:
Rene Gollent
2013-07-11 07:35:06 -04:00
parent 8b2fbc4fa0
commit 8832917f2c
@@ -902,9 +902,7 @@ SourceView::MarkerView::Draw(BRect updateRect)
// get the lines intersecting with the update rect // get the lines intersecting with the update rect
int32 minLine, maxLine; int32 minLine, maxLine;
GetLineRange(updateRect, minLine, maxLine); GetLineRange(updateRect, minLine, maxLine);
if (minLine > maxLine) if (minLine <= maxLine) {
return;
// get the markers in that range // get the markers in that range
SourceView::MarkerManager::MarkerList markers; SourceView::MarkerManager::MarkerList markers;
fMarkerManager->GetMarkers(minLine, maxLine, markers); fMarkerManager->GetMarkers(minLine, maxLine, markers);
@@ -940,6 +938,7 @@ SourceView::MarkerView::Draw(BRect updateRect)
SetHighColor(fBreakpointOptionMarker); SetHighColor(fBreakpointOptionMarker);
FillEllipse(BPoint(width - 8, y), 2, 2); FillEllipse(BPoint(width - 8, y), 2, 2);
} }
}
float y = (maxLine + 1) * fFontInfo->lineHeight; float y = (maxLine + 1) * fFontInfo->lineHeight;
if (y < updateRect.bottom) { if (y < updateRect.bottom) {
@@ -1154,6 +1153,7 @@ SourceView::TextView::Draw(BRect updateRect)
y = (maxLine + 1) * fFontInfo->lineHeight; y = (maxLine + 1) * fFontInfo->lineHeight;
if (y < updateRect.bottom) { if (y < updateRect.bottom) {
SetLowColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR));
FillRect(BRect(0.0, y, Bounds().right, updateRect.bottom), FillRect(BRect(0.0, y, Bounds().right, updateRect.bottom),
B_SOLID_LOW); B_SOLID_LOW);
} }