Debugger: Fix calculation in MemoryView.

- The offset calculation for mapping the current point wasn't taking
  into account the number of bytes per hex block, causing it to be
  proportionally further off if one switched to 16/32/64-bit hex mode.

Gets mouse selection working properly in said modes.
This commit is contained in:
Rene Gollent 2013-09-17 11:14:38 +02:00
parent f2479c22a8
commit a82e311cf1

View File

@ -677,7 +677,7 @@ MemoryView::_GetOffsetAt(BPoint point) const
float blockWidth = (charsPerBlock * 2 + 1) * fCharWidth;
int32 containingBlock = int32(floor(point.x / blockWidth));
return fHexBlocksPerLine * lineNumber
return fHexBlocksPerLine * charsPerBlock * lineNumber
+ containingBlock * charsPerBlock;
}