diff --git a/Windows/Debugger/CtrlMemView.cpp b/Windows/Debugger/CtrlMemView.cpp index fa934e11c0..ff28e1b99d 100644 --- a/Windows/Debugger/CtrlMemView.cpp +++ b/Windows/Debugger/CtrlMemView.cpp @@ -198,9 +198,9 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam) SelectObject(hdc,standardBrush); Rectangle(hdc,0,0,rect.right,rect.bottom); - if (writeOffsets) { + if (displayOffsetScale) drawOffsetScale(hdc); - } + // draw one extra row that may be partially visible for (int i = 0; i < visibleRows+1; i++) @@ -210,7 +210,7 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam) unsigned int address=windowStart + i*rowSize; int rowY = rowHeight*i; - if (writeOffsets) + if (displayOffsetScale) rowY += rowHeight * offsetSpace; // skip the first X rows to make space for the offsets @@ -419,7 +419,7 @@ void CtrlMemView::redraw() GetClientRect(wnd, &rect); visibleRows = (rect.bottom/rowHeight); - if (writeOffsets) { + if (displayOffsetScale) { visibleRows -= offsetSpace; // visibleRows is calculated based on the size of the control, but X rows have already been used for the offsets and are no longer usable } @@ -531,7 +531,7 @@ void CtrlMemView::gotoPoint(int x, int y) int line = y/rowHeight; int lineAddress = windowStart+line*rowSize; - if (writeOffsets) + if (displayOffsetScale) { if (line < offsetSpace) // ignore clicks on the offset space { @@ -757,9 +757,9 @@ void CtrlMemView::drawOffsetScale(HDC hdc) void CtrlMemView::toggleOffsetScale(OffsetToggles toggle) { if (toggle == On) - writeOffsets = true; + displayOffsetScale = true; else if (toggle == Off) - writeOffsets = false; + displayOffsetScale = false; updateStatusBarText(); redraw(); diff --git a/Windows/Debugger/CtrlMemView.h b/Windows/Debugger/CtrlMemView.h index b4c3129ad8..d5f8079d7f 100644 --- a/Windows/Debugger/CtrlMemView.h +++ b/Windows/Debugger/CtrlMemView.h @@ -20,8 +20,8 @@ #include "../../Core/Debugger/DebugInterface.h" enum OffsetSpacing { - offsetSpace = 3, - offsetLine = 1, + offsetSpace = 3, // the number of blank lines that should be left to make space for the offsets + offsetLine = 1, // the line on which the offsets should be written }; enum OffsetToggles { @@ -49,7 +49,7 @@ class CtrlMemView bool asciiSelected; int selectedNibble; - bool writeOffsets = false; + bool displayOffsetScale = false; int visibleRows;