Fix sticking out highlighting on graph (#881)

This commit is contained in:
Adam Zambrzycki 2018-10-27 18:36:14 +02:00 committed by xarkes
parent ca1fb52bb7
commit e219b8daba

View File

@ -501,7 +501,16 @@ void DisassemblerGraphView::drawBlock(QPainter &p, GraphView::GraphBlock &block)
}
int widthBefore = mFontMetrics->width(instr.plainText.left(pos));
p.fillRect(QRect(block.x + charWidth * 3 + widthBefore, y, tokenWidth,
if (widthBefore + charWidth * 7 > block.width) {
continue;
}
int highlightWidth = tokenWidth;
if (widthBefore + tokenWidth >= block.width) {
highlightWidth = block.width - widthBefore - charWidth * 5;
}
p.fillRect(QRect(block.x + charWidth * 3 + widthBefore, y, highlightWidth,
charHeight), disassemblySelectionColor.lighter(250));
}