D17742: Clean up content rect in TerminalDisplay

Kurt Hindenburg noreply at phabricator.kde.org
Tue Feb 12 18:18:28 GMT 2019


hindenburg added a comment.


  Thanks still working on reading these changes.

INLINE COMMENTS

> TerminalDisplay.cpp:1614
>      QRegion dirtyImageRegion;
> -    foreach(const QRect & rect, (pe->region() & contentsRect()).rects()) {
> +    for (const QRect &rect : (pe->region() & rect()).rects()) {
>          dirtyImageRegion += widgetToImage(rect);

Did you mean to change contentsRect() to rect()?    rect() doesn't appear to take into account the scrollbar

> TerminalDisplay.cpp:1633
> +        for (const QRect &rect : (pe->region() & rect()).rects()) {
>              paint.fillRect(rect, dimColor);
>          }

same here

> TerminalDisplay.cpp:2035
>      QRect result;
> -    result.setLeft(  qMin(_usedColumns - 1, qMax(0, (widgetArea.left()   - contentsRect().left() - _contentRect.left()) / _fontWidth )));
> -    result.setTop(   qMin(_usedLines   - 1, qMax(0, (widgetArea.top()    - contentsRect().top()  - _contentRect.top() ) / _fontHeight)));
> -    result.setRight( qMin(_usedColumns - 1, qMax(0, (widgetArea.right()  - contentsRect().left() - _contentRect.left()) / _fontWidth )));
> -    result.setBottom(qMin(_usedLines   - 1, qMax(0, (widgetArea.bottom() - contentsRect().top()  - _contentRect.top() ) / _fontHeight)));
> +    result.setLeft(  qMin(_usedColumns - 1, qMax(0, (widgetArea.left()   - contentsRect().left()) / _fontWidth )));
> +    result.setTop(   qMin(_usedLines   - 1, qMax(0, (widgetArea.top()    - contentsRect().top() ) / _fontHeight)));

Was the old code having 2 contentsRect().left()  a mistake?

REPOSITORY
  R319 Konsole

REVISION DETAIL
  https://phabricator.kde.org/D17742

To: sandsmark, hindenburg, #konsole
Cc: konsole-devel, #konsole, gennad, maciejn, thsurrel, ngraham, maximilianocuria, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20190212/bf08d57c/attachment-0001.html>


More information about the konsole-devel mailing list