Do not paint long pre-edit text outside display

Summary: {F5822474}

Test Plan:
* Turn on IME (tested with ibus+anthy)
* Type (without accepting) long text using IME

Expected result: text should not be drawn outside terminal
Actual result: text is drawn on terminal, margins, scrollbar

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12556
wilder-portage
Mariusz Glebocki 8 years ago committed by Kurt Hindenburg
parent b0d3d83eca
commit ca36b88619
  1. 9
      src/TerminalDisplay.cpp

@ -3395,11 +3395,12 @@ QRect TerminalDisplay::preeditRect() const
if (preeditLength == 0) { if (preeditLength == 0) {
return QRect(); return QRect();
} }
const QRect stringRect(_contentRect.left() + _fontWidth * cursorPosition().x(),
_contentRect.top() + _fontHeight * cursorPosition().y(),
_fontWidth * preeditLength,
_fontHeight);
return QRect(_contentRect.left() + _fontWidth * cursorPosition().x(), return stringRect.intersected(_contentRect);
_contentRect.top() + _fontHeight * cursorPosition().y(),
_fontWidth * preeditLength,
_fontHeight);
} }
void TerminalDisplay::drawInputMethodPreeditString(QPainter& painter , const QRect& rect) void TerminalDisplay::drawInputMethodPreeditString(QPainter& painter , const QRect& rect)

Loading…
Cancel
Save