[LyX features/biginset] Fixup Implement quick scroll

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed Aug 30 10:51:25 UTC 2023


The branch, biginset, has been updated.

- Log -----------------------------------------------------------------

commit d46bb7c6fd209ad08889b87b79dea29b10019d86
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Wed Aug 30 14:07:38 2023 +0200

    Fixup Implement quick scroll

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index cb96843..ac17c9b 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -3117,7 +3117,7 @@ void BufferView::updateMetrics(bool force)
 		// The anchor pit must have been deleted...
 		d->anchor_pit_ = npit - 1;
 
-	if (force || !tm.contains(d->anchor_pit_))
+	if (!tm.contains(d->anchor_pit_))
 		// Rebreak anchor paragraph.
 		tm.redoParagraph(d->anchor_pit_);
 	ParagraphMetrics & anchor_pm = tm.parMetrics(d->anchor_pit_);
@@ -3144,7 +3144,7 @@ void BufferView::updateMetrics(bool force)
 	// We are now just above the anchor paragraph.
 	pit_type pit1 = d->anchor_pit_ - 1;
 	for (; pit1 >= 0 && y1 > 0; --pit1) {
-		if (force || !tm.contains(pit1))
+		if (!tm.contains(pit1))
 			tm.redoParagraph(pit1);
 		ParagraphMetrics & pm = tm.parMetrics(pit1);
 		y1 -= pm.descent();
@@ -3158,7 +3158,7 @@ void BufferView::updateMetrics(bool force)
 	// We are now just below the anchor paragraph.
 	pit_type pit2 = d->anchor_pit_ + 1;
 	for (; pit2 < npit && y2 < height_; ++pit2) {
-		if (force || !tm.contains(pit2))
+		if (!tm.contains(pit2))
 			tm.redoParagraph(pit2);
 		ParagraphMetrics & pm = tm.parMetrics(pit2);
 		y2 += pm.ascent();
@@ -3167,16 +3167,15 @@ void BufferView::updateMetrics(bool force)
 		y2 += pm.descent();
 	}
 
+	//FIXME: do we want that?
 	// if updating, remove paragraphs that are outside of screen
-	if (!force) {
-		while(tm.first().second->bottom() < 0) {
-			//LYXERR0("Forget pit: " << tm.first().first);
-			tm.forget(tm.first().first);
-		}
-		while(tm.last().second->top() > height_) {
-			//LYXERR0("Forget pit: " << tm.first().first);
-			tm.forget(tm.last().first);
-		}
+	while(tm.first().second->bottom() < 0) {
+		//LYXERR0("Forget pit: " << tm.first().first);
+		tm.forget(tm.first().first);
+	}
+	while(tm.last().second->top() > height_) {
+		//LYXERR0("Forget pit: " << tm.first().first);
+		tm.forget(tm.last().first);
 	}
 
 	// Normalize anchor for next time

-----------------------------------------------------------------------

Summary of changes:
 src/BufferView.cpp |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
Repository for new features


More information about the lyx-cvs mailing list