# HG changeset patch # User John W. Eaton # Date 1383810390 18000 # Node ID 7d9a4eef802223499b227b1e3a21925c4c8f9245 # Parent 5ac0545fb4c0c2c89ba3fa6975c42434b4f3f19a backout changeset 4de2eeb7d790 diff -r 5ac0545fb4c0 -r 7d9a4eef8022 libgui/qterminal/libqterminal/unix/TerminalView.cpp --- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp Thu Nov 07 01:42:26 2013 -0500 +++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp Thu Nov 07 02:46:30 2013 -0500 @@ -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