[LyX/master] Restore some checks that were useful for search
Pavel Sanda
sanda at lyx.org
Wed Jul 26 19:34:27 UTC 2023
commit 7f23bd4acad244f91294d3543cdfb3e84a77a6da
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date: Wed Jul 26 21:13:51 2023 +0200
Restore some checks that were useful for search
It is really back of the enveloppe spacing, but people liked it this way.
Fixes ticket #12767.
---
src/BufferView.cpp | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 12afa84..28577f2 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1079,6 +1079,11 @@ bool BufferView::scrollToCursor(DocIterator const & dit, ScrollType how)
d->anchor_ypos_ += height_/2 - row_dim.height() / 2;
else if (!lyxrc.scroll_below_document && d->anchor_pit_ == max_pit)
d->anchor_ypos_ = height_ - offset - row_dim.descent();
+ else if (offset > height_)
+ d->anchor_ypos_ = height_ - offset - defaultRowHeight();
+ else
+ d->anchor_ypos_ = defaultRowHeight() * 2;
+
return d->anchor_ypos_ != old_ypos || d->anchor_pit_ != old_pit;
}
More information about the lyx-cvs
mailing list