Skip to content

Commit

Permalink
fix aliasing issue on wayland
Browse files Browse the repository at this point in the history
when multiple lines are selected, the drawn selection box shows
interruption (white lines) when antialiasing is active
  • Loading branch information
sunderme committed Jan 3, 2025
1 parent fd5ffda commit 95b057b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/qcodeedit/lib/document/qdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6916,6 +6916,8 @@ void QDocumentPrivate::drawTextLine(QPainter *p, QDocument::PaintContext &cxt, D
}

// draw the background
pr->save();
pr->setRenderHint(QPainter::Antialiasing, false);
if (useLineCache) {
pr->translate(-cxt.xoffset,0);
pr->fillRect(QRectF(0, 0, m_leftPadding, ht), background);
Expand All @@ -6924,6 +6926,7 @@ void QDocumentPrivate::drawTextLine(QPainter *p, QDocument::PaintContext &cxt, D
pr->fillRect(QRectF(m_leftPadding, 0, m_width - m_leftPadding, ht), selectionBackground);
} else
pr->fillRect(QRectF(0, 0, m_width, ht), background);
pr->restore();

qreal y = 0;
if (!useLineCache && lcxt.visiblePos > lcxt.pos)
Expand Down

0 comments on commit 95b057b

Please sign in to comment.