mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-22 22:53:49 +00:00
Fix an off by 1 bug during hexwidget cursor blinking. (#2368)
1 pixel line sometimes remained on during hexwidget cursor blinking.
This commit is contained in:
parent
2d95786f6e
commit
dcb9970f91
@ -415,7 +415,7 @@ void HexWidget::paintEvent(QPaintEvent *event)
|
|||||||
if (xOffset > 0)
|
if (xOffset > 0)
|
||||||
painter.translate(QPoint(-xOffset, 0));
|
painter.translate(QPoint(-xOffset, 0));
|
||||||
|
|
||||||
if (event->rect() == cursor.screenPos) {
|
if (event->rect() == cursor.screenPos.toAlignedRect()) {
|
||||||
/* Cursor blink */
|
/* Cursor blink */
|
||||||
drawCursor(painter);
|
drawCursor(painter);
|
||||||
return;
|
return;
|
||||||
@ -640,7 +640,7 @@ void HexWidget::onCursorBlinked()
|
|||||||
if (!cursorEnabled)
|
if (!cursorEnabled)
|
||||||
return;
|
return;
|
||||||
cursor.blink();
|
cursor.blink();
|
||||||
QRect cursorRect(cursor.screenPos.x(), cursor.screenPos.y(), cursor.screenPos.width(), cursor.screenPos.height());
|
QRect cursorRect = cursor.screenPos.toAlignedRect();
|
||||||
viewport()->update(cursorRect.translated(-horizontalScrollBar()->value(), 0));
|
viewport()->update(cursorRect.translated(-horizontalScrollBar()->value(), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user