[LyX/master] Fixup 294969c6: do not forget to update metrics

Jean-Marc Lasgouttes lasgouttes at lyx.org
Tue Apr 14 15:38:14 UTC 2020


commit 543038e64e055050dfd03725f88b462571bab9f0
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Tue Apr 14 17:57:49 2020 +0200

    Fixup 294969c6: do not forget to update metrics
---
 src/BufferView.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index e31efcf..9430ba4 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -528,12 +528,15 @@ void BufferView::processUpdateFlags(Update::flags flags)
 			// First try to make the selection start visible
 			// (which is just the cursor when there is no selection)
 			scrollToCursor(d->cursor_.selectionBegin(), false);
+			// Metrics have to be recomputed (maybe again)
+			updateMetrics();
 			// Is the cursor visible? (only useful if cursor is at end of selection)
-			if (needsFitCursor())
+			if (needsFitCursor()) {
 				// then try to make cursor visible instead
 				scrollToCursor(d->cursor_, false);
-			// Metrics have to be recomputed (maybe again)
-			updateMetrics(flags);
+				// Metrics have to be recomputed (maybe again)
+				updateMetrics(flags);
+			}
 		}
 		flags = flags & ~Update::FitCursor;
 	}


More information about the lyx-cvs mailing list