diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 092db3c340..0d581b664e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-04 12:20 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + ! Fixed: glitch in selected text background color off by few pixels. + 2010-07-04 20:45 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * external/Makefile diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 6b7de75912..7ae2debccd 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -1602,10 +1602,12 @@ void HBQPlainTextEdit::hbPaintSelection( QPaintEvent * event ) int rb = rowBegins <= rowEnds ? rowBegins : rowEnds; int re = rowBegins <= rowEnds ? rowEnds : rowBegins; + int ttop = ( int ) blockBoundingGeometry( firstVisibleBlock() ).translated( contentOffset() ).top(); + int t = firstVisibleBlock().blockNumber(); int c = hbFirstVisibleColumn(); int fontHeight = fontMetrics().height(); - int b = t + ( viewport()->height() / fontHeight ) + 1; + int b = t + ( ( viewport()->height() - ttop ) / fontHeight ) + 1; re = re > b ? b : re; @@ -1616,7 +1618,7 @@ void HBQPlainTextEdit::hbPaintSelection( QPaintEvent * event ) int marginX = ( c > 0 ? 0 : contentsRect().left() ) + 2 ; int fontWidth = fontMetrics().averageCharWidth(); - int top = ( ( rb <= t ) ? 0 : ( ( rb - t ) * fontHeight ) ); + int top = ( ( rb <= t ) ? 0 : ( ( rb - t ) * fontHeight ) ) + ttop; int btm = ( ( re - t + 1 ) * fontHeight ) - top; btm = btm > viewport()->height() ? viewport()->height() : btm; QBrush br( m_selectionColor );