# HG changeset patch # User John W. Eaton # Date 1383673712 18000 # Node ID c17a3e43956bbdb2a53eccd3453b29a95f6b03ed # Parent bfbe5dcc99435aa7f5295d09f91c3b7fe10f15c4 avoid partial lines at top of command window * TerminalView.cpp (TerminalView::drawContents, TerminalView::calcGeometry): Use qFloor instead of qRound. diff -r bfbe5dcc9943 -r c17a3e43956b libgui/qterminal/libqterminal/unix/TerminalView.cpp --- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp Tue Nov 05 07:05:30 2013 +0000 +++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp Tue Nov 05 12:48:32 2013 -0500 @@ -1230,10 +1230,10 @@ // int topLeftX = (_contentWidth - _usedColumns * _fontWidth) / 2; int topLeftX = 0; - int leftUpperX = qMin(_usedColumns-1, qMax(0, qRound((rect.left() - topLeftX - _leftMargin ) / _fontWidth))); - int leftUpperY = qMin(_usedLines-1, qMax(0, qRound((rect.top() - topLeftY - _topMargin ) / _fontHeight))); - int rightLowerX = qMin(_usedColumns-1, qMax(0, qRound((rect.right() - topLeftX - _leftMargin ) / _fontWidth))); - int rightLowerY = qMin(_usedLines-1, qMax(0, qRound((rect.bottom() - topLeftY - _topMargin ) / _fontHeight))); + int leftUpperX = qMin(_usedColumns-1, qMax(0, qFloor((rect.left() - topLeftX - _leftMargin ) / _fontWidth))); + int leftUpperY = qMin(_usedLines-1, qMax(0, qFloor((rect.top() - topLeftY - _topMargin ) / _fontHeight))); + int rightLowerX = qMin(_usedColumns-1, qMax(0, qFloor((rect.right() - topLeftX - _leftMargin ) / _fontWidth))); + int rightLowerY = qMin(_usedLines-1, qMax(0, qFloor((rect.bottom() - topLeftY - _topMargin ) / _fontHeight))); const int bufferSize = _usedColumns; QChar *disstrU = new QChar[bufferSize]; @@ -2533,11 +2533,11 @@ if (!_isFixedSize) { // ensure that display is always at least one column wide - _columns = qMax(1,qRound(_contentWidth / _fontWidth)); + _columns = qMax(1,qFloor(_contentWidth / _fontWidth)); _usedColumns = qMin(_usedColumns,_columns); // ensure that display is always at least one line high - _lines = qMax(1, qRound(_contentHeight / _fontHeight)); + _lines = qMax(1, qFloor(_contentHeight / _fontHeight)); _usedLines = qMin(_usedLines,_lines); } }