mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
Fix highlight stick out fix (#896)
This commit is contained in:
parent
8ff2a88199
commit
4434e146bf
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user