[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sw/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Jan 15 05:46:26 PST 2015


 sw/source/core/view/viewimp.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 435126e00cf48fe95d8f238aec726a378f8392a5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jan 15 14:39:45 2015 +0100

    SwViewImp::AddPaintRect: when tiled rendering, ignore visual area
    
    With this, gtktiledviewer gets the proper invalidation rectangles after
    keypresses.
    
    Change-Id: I9bd1f5b59d05ae93a0a1d018dda8b2efc01cb38c

diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index b08aa42..35805bf 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -132,10 +132,16 @@ void SwViewImp::DelRegion()
 
 bool SwViewImp::AddPaintRect( const SwRect &rRect )
 {
-    if ( rRect.IsOver( pSh->VisArea() ) )
+    // In case of tiled rendering the visual area is the last painted tile -> not interesting.
+    if ( rRect.IsOver( pSh->VisArea() ) || pSh->isTiledRendering() )
     {
         if ( !pRegion )
-            pRegion = new SwRegionRects( pSh->VisArea() );
+        {
+            // In case of normal rendering, this makes sure only visible rectangles are painted.
+            // Otherwise get the rectangle of the full document, so all paint rectangles are invalidated.
+            const SwRect& rArea = pSh->isTiledRendering() ? pSh->GetLayout()->Frm() : pSh->VisArea();
+            pRegion = new SwRegionRects( rArea );
+        }
         (*pRegion) -= rRect;
         return true;
     }


More information about the Libreoffice-commits mailing list