Mercurial > hg > octave-nkf
changeset 17872:7d9a4eef8022
backout changeset 4de2eeb7d790
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 07 Nov 2013 02:46:30 -0500 |
parents | 5ac0545fb4c0 |
children | 58b39152b0f6 |
files | libgui/qterminal/libqterminal/unix/TerminalView.cpp |
diffstat | 1 files changed, 16 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp +++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp @@ -661,10 +661,9 @@ */ void TerminalDisplay::setCursorPos(const int curx, const int cury) { - // Align contents with bottom of view by computing top coordinate - QPoint bL = contentsRect().bottomLeft(); - int tLx = bL.x(); - int tLy = bL.y()-2*_topMargin-_fontHeight*_lines+1; + QPoint tL = contentsRect().topLeft(); + int tLx = tL.x(); + int tLy = tL.y(); int xpos, ypos; ypos = _topMargin + tLy + _fontHeight*(cury-1) + _fontAscent; @@ -716,7 +715,7 @@ void* firstCharPos = &_image[ region.top() * this->_columns ]; void* lastCharPos = &_image[ (region.top() + abs(lines)) * this->_columns ]; - int top = contentsRect().height() - _topMargin - (_lines * _fontHeight) + (region.top() * _fontHeight); + int top = _topMargin + (region.top() * _fontHeight); int linesToMove = region.height() - abs(lines); int bytesToMove = linesToMove * this->_columns * @@ -831,10 +830,10 @@ int y,x,len; - // Align contents with bottom of view by computing top coordinate - QPoint bL = contentsRect().bottomLeft(); - int tLx = bL.x(); - int tLy = bL.y()-2*_topMargin-_fontHeight*_lines+1; + QPoint tL = contentsRect().topLeft(); + + int tLx = tL.x(); + int tLy = tL.y(); _hasBlinker = false; CharacterColor cf; // undefined @@ -1099,13 +1098,8 @@ if ( preeditLength == 0 ) return QRect(); - // Align contents with bottom of view by computing top coordinate - QPoint bL = contentsRect().bottomLeft(); - int tLx = bL.x(); - int tLy = bL.y()-2*_topMargin-_fontHeight*_lines+1; - return QRect(_leftMargin + _fontWidth*cursorPosition().x(), - _topMargin + tLy + _fontHeight*cursorPosition().y(), + _topMargin + _fontHeight*cursorPosition().y(), _fontWidth*preeditLength, _fontHeight); } @@ -1219,10 +1213,9 @@ { //qDebug("%s %d drawContents and rect x=%d y=%d w=%d h=%d", __FILE__, __LINE__, rect.x(), rect.y(),rect.width(),rect.height()); - // Align contents with bottom of view by computing top coordinate - QPoint bottomLeft = contentsRect().bottomLeft(); - int bottomLeftY = bottomLeft.y(); - int topLeftY = bottomLeftY-2*_topMargin-_fontHeight*_lines+1; + QPoint topLeft = contentsRect().topLeft(); + // Take the topmost vertical position for the view. + int topLeftY = topLeft.y(); // In Konsole, the view has been centered. Don't do that here, since there // are strange hopping effects during a resize when the view does no match @@ -1368,15 +1361,10 @@ QRect TerminalView::imageToWidget(const QRect& imageArea) const { - // Align contents with bottom of view by computing top coordinate - QPoint bL = contentsRect().bottomLeft(); - int tLx = bL.x(); - int tLy = bL.y()-2*_topMargin-_fontHeight*_lines+1; - //qDebug("%s %d imageToWidget", __FILE__, __LINE__); QRect result; result.setLeft( _leftMargin + _fontWidth * imageArea.left() ); - result.setTop( _topMargin + tLy + _fontHeight * imageArea.top() ); + result.setTop( _topMargin + _fontHeight * imageArea.top() ); result.setWidth( _fontWidth * imageArea.width() ); result.setHeight( _fontHeight * imageArea.height() ); @@ -1742,10 +1730,9 @@ return; } - // Align contents with bottom of view by computing top coordinate - QPoint bL = contentsRect().bottomLeft(); - int tLx = bL.x(); - int tLy = bL.y()-2*_topMargin-_fontHeight*_lines+1; + QPoint tL = contentsRect().topLeft(); + int tLx = tL.x(); + int tLy = tL.y(); int scroll = _scrollBar->value(); // we're in the process of moving the mouse with the left button pressed