We don't need to paint the rect twice

wilder
Martin T. H. Sandsmark 4 years ago committed by Tomaz Canabrava
parent 93cabe1f23
commit 2ed0cdd3c9
  1. 3
      src/terminalDisplay/TerminalPainter.cpp

@ -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);

Loading…
Cancel
Save