Skip to content

Commit

Permalink
fix: 修复图标闪烁CPU占用较高的问题
Browse files Browse the repository at this point in the history
Log: 修复图标闪烁CPU占用较高的问题
Signed-off-by: Yutao Meng <[email protected]>
  • Loading branch information
ArchieMeng committed Nov 30, 2023
1 parent de13409 commit 555825c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 3rdparty/terminalwidget/lib/TerminalDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1855,16 +1855,16 @@ QRect TerminalDisplay::widgetToImage(const QRect &widgetArea) const
{
QRect result;
result.setLeft(qMin(_usedColumns - 1, qMax(0, (widgetArea.left()) / _fontWidth )));
result.setTop(qMin(_usedLines - 1, qMax(0, (widgetArea.top()) / _fontHeight)));
result.setTop(qMin(_usedLines - 1, qMax(0, (widgetArea.top()) / _fontHeight )));
result.setRight(qMin(_usedColumns - 1, qMax(0, (widgetArea.right()) / _fontWidth )));
result.setBottom(qMin(_usedLines - 1, qMax(0, (widgetArea.bottom()) / _fontHeight)));
return result;
}

void TerminalDisplay::updateCursor()
{
// QRect cursorRect = imageToWidget( QRect(cursorPosition(),QSize(1,1)) );
update();
QRect cursorRect = imageToWidget( QRect(cursorPosition(),QSize(1,1)) );
update(cursorRect);
}

void TerminalDisplay::blinkCursorEvent()
Expand Down

0 comments on commit 555825c

Please sign in to comment.