Fix highlight stick out fix (#896)

This commit is contained in:
Adam Zambrzycki 2018-11-01 17:00:19 +01:00 committed by Itay Cohen
parent 8ff2a88199
commit 4434e146bf

View File

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