I wonder if this is correct and if it makes any sense.

It certainly looks correct to me (seems to run correctly as well), so
am committing it. Are there any hidden gotchas with theCoords?

(Btw. this saves about 10k from a stripped image)

Index: src/BufferView_pimpl.C
===================================================================
--- src/BufferView_pimpl.C      (revision 14331)
+++ src/BufferView_pimpl.C      (working copy)
@@ -701,33 +701,29 @@
                // Update macro store
                buffer_->buildMacros();

-               CoordCache backup;
-               std::swap(theCoords, backup);
-
                // This, together with doneUpdating(), verifies (using
                // asserts) that screen redraw is not called from
                // within itself.
                theCoords.startUpdating();

                // First drawing step
-               updateMetrics(flags & Update::SinglePar);
+               bool singlePar = flags & Update::SinglePar;
                bool forceupdate(flags & (Update::Force | Update::SinglePar));

-               if ((flags & Update::FitCursor) && fitCursor()) {
-                       forceupdate = true;
-                       updateMetrics();
-               }
-               if ((flags & Update::MultiParSel) && multiParSel()) {
+               if ((flags & (Update::FitCursor | Update::MultiParSel))
+                   && (fitCursor() || multiParSel())) {
                        forceupdate = true;
-                       updateMetrics();
+                       singlePar = false;
                }
+
                if (forceupdate) {
                        // Second drawing step
+                       updateMetrics(singlePar);
                        owner_->workArea()->redraw(*bv_);
                } else {
                        // Abort updating of the coord
                        // cache - just restore the old one
-                       std::swap(theCoords, backup);
+                       theCoords.doneUpdating();
                }
        } else
                owner_->workArea()->greyOut();

-- 
        Lgb

Reply via email to