From 4434e146bf76799de974ab96f0130f1a55abc387 Mon Sep 17 00:00:00 2001 From: Adam Zambrzycki Date: Thu, 1 Nov 2018 17:00:19 +0100 Subject: [PATCH] Fix highlight stick out fix (#896) --- src/widgets/DisassemblerGraphView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/DisassemblerGraphView.cpp b/src/widgets/DisassemblerGraphView.cpp index 56d51199..cefa94d7 100644 --- a/src/widgets/DisassemblerGraphView.cpp +++ b/src/widgets/DisassemblerGraphView.cpp @@ -501,13 +501,13 @@ void DisassemblerGraphView::drawBlock(QPainter &p, GraphView::GraphBlock &block) } int widthBefore = mFontMetrics->width(instr.plainText.left(pos)); - if (widthBefore + charWidth * 7 > block.width) { + if (charWidth * 3 + widthBefore > block.width - (10 + 2 * charWidth)) { continue; } int highlightWidth = tokenWidth; - if (widthBefore + tokenWidth >= block.width) { - highlightWidth = block.width - widthBefore - charWidth * 5; + if (charWidth * 3 + widthBefore + tokenWidth >= block.width - (10 + 2 * charWidth)) { + highlightWidth = block.width - widthBefore - (10 + 4 * charWidth); } p.fillRect(QRect(block.x + charWidth * 3 + widthBefore, y, highlightWidth,