Commit 2ed0cdd3 authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Tomaz Canabrava
Browse files

We don't need to paint the rect twice

parent 93cabe1f
......@@ -549,13 +549,14 @@ void TerminalPainter::drawCursor(QPainter &painter, const QRect &rect, const QCo
painter.setPen(pen);
if (display->cursorShape() == Enum::BlockCursor) {
painter.drawRect(cursorRect.adjusted(halfWidth, halfWidth, -halfWidth, -halfWidth));
if (display->hasFocus()) {
painter.fillRect(cursorRect, cursorColor);
QColor cursorTextColor = display->terminalColor()->cursorTextColor();
characterColor = cursorTextColor.isValid() ? cursorTextColor : backgroundColor;
} else {
painter.drawRect(cursorRect.adjusted(halfWidth, halfWidth, -halfWidth, -halfWidth));
}
} else if (display->cursorShape() == Enum::UnderlineCursor) {
QLineF line(cursorRect.left() + halfWidth, cursorRect.bottom() - halfWidth, cursorRect.right() - halfWidth, cursorRect.bottom() - halfWidth);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment