]> git.lyx.org Git - lyx.git/commit
Make sure paragraph positions are updated when scrolling
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 2 Jul 2024 22:22:55 +0000 (00:22 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 10 Jul 2024 15:18:47 +0000 (17:18 +0200)
commit288684356016f5cca7959462735f6153cd1adab2
tree569dcf5dcbb406e70dcc5c8a50eb34e8eeb462ed
parent10b8861d103490e4598582608ac60407d6b0b711
Make sure paragraph positions are updated when scrolling

Sometimes quick selection-scrolling could cause a crash because the
position of some paragraphs is not computed. To fix that, in
BufferView::showCursor, make sure that the metrics are always kept
clean using updateMetrics(false), which is lighweight.

As a consequence, the 'update' parameter of showCursor and
scrollDocView is not needed anymore. Its removal is mechanical and
accounts for most of this commit.

The only other significant change is that, when creating synthetic
mouse events and relying on scroll() for small moves, the full metrics
recomputation is replaced by the lighter version.

More work is still to come on this code, but this should be going in
the right direction.

(cherry picked from commit 6e0ea4269ae792225bb4e0d0f0ffcb3236c3c5c9)
src/BufferView.cpp
src/BufferView.h
src/frontends/qt/GuiWorkArea.cpp