]> git.lyx.org Git - features.git/commitdiff
Do not modify the changed() status of rows when no drawing has taken place
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 30 Jan 2015 10:18:04 +0000 (11:18 +0100)
committerScott Kostyshak <skostysh@lyx.org>
Sun, 8 Feb 2015 21:18:56 +0000 (16:18 -0500)
There are several places in the code where a row is painted with drawing disabled in the painter. The goal is only to recompute inset positions.

Such a case happens in BufferView::checkCursorScrollOffset, as part of the horizontal scrolling patch.

It makes sens to consider that only a real painting of a row should change its status. However, I would not be surprised if this change would break other things.

Fixes: #9388
src/TextMetrics.cpp

index f29202c668644dc6dada33af211f7fd25ac7435b..2119f8ed16037416359c9792d3187e8878516310 100644 (file)
@@ -1878,7 +1878,8 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const
                }
 
                // Row signature; has row changed since last paint?
-               row.setCrc(pm.computeRowSignature(row, bparams));
+               if (pi.pain.isDrawingEnabled())
+                       row.setCrc(pm.computeRowSignature(row, bparams));
                bool row_has_changed = row.changed()
                        || rowSlice == bv_->lastRowSlice();
 
@@ -1916,7 +1917,8 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const
                        LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " row=" << i
                                << " row_selection="    << row.selection()
                                << " full_repaint="     << pi.full_repaint
-                               << " row_has_changed="  << row_has_changed);
+                               << " row_has_changed="  << row_has_changed
+                               << " drawingEnabled=" << pi.pain.isDrawingEnabled());
                }
 
                // Backup full_repaint status and force full repaint