diff --git a/src/widgets/DisassemblerGraphView.cpp b/src/widgets/DisassemblerGraphView.cpp index 3a964200..56d51199 100644 --- a/src/widgets/DisassemblerGraphView.cpp +++ b/src/widgets/DisassemblerGraphView.cpp @@ -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)); }