1
0
Fork 0

GUI: Possibly fix #406, #401, #243 (NEEDS CHECKING)

This may have unintended side effects.
This commit is contained in:
Nukem 2015-10-18 23:53:43 -04:00
parent 1b4c97ebad
commit 4ea160e709
2 changed files with 15 additions and 5 deletions

View File

@ -911,16 +911,24 @@ dsint AbstractTableView::getTableOffset()
return mTableOffset;
}
void AbstractTableView::setTableOffset(dsint val)
{
dsint wMaxOffset = getRowCount() - getViewableRowsCount() + 1;
wMaxOffset = wMaxOffset > 0 ? wMaxOffset : 0;
// Don't allow the new row value to go past the maximum
dsint wMaxOffset = getRowCount();
if(val > wMaxOffset)
return;
// Change the row index so that it isn't scrolled completely
// to the bottom of the table
if (val > (wMaxOffset - getViewableRowsCount()))
val -= (getViewableRowsCount() - 3);
// Signals
mTableOffset = val;
emit tableOffsetChanged(val);
// Change the scrollbar position
#ifdef _WIN64
int wNewValue = scaleFromUint64ToScrollBarRange(mTableOffset);
verticalScrollBar()->setValue(wNewValue);

View File

@ -54,8 +54,10 @@ void HexDump::printDumpAt(dsint parVA, bool select, bool repaint)
dsint wRowCount;
// Byte offset used to be aligned on the given RVA
mByteOffset = (int)((dsint)wRVA % (dsint)wBytePerRowCount);
mByteOffset = mByteOffset > 0 ? wBytePerRowCount - mByteOffset : 0;
// TODO: CHECK THIS
mByteOffset = 0;
// mByteOffset = (int)((dsint)wRVA % (dsint)wBytePerRowCount);
// mByteOffset = mByteOffset > 0 ? wBytePerRowCount - mByteOffset : 0;
// Compute row count
wRowCount = wSize / wBytePerRowCount;