]> 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>
Tue, 2 Jul 2024 22:34:11 +0000 (00:34 +0200)
commit6e0ea4269ae792225bb4e0d0f0ffcb3236c3c5c9
treee13eaadc308f703a3d4d47968808347ac372264e
parent65a5c3989f2b9fa0f7f2a381cce0beb9ef2e1823
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.
src/BufferView.cpp
src/BufferView.h
src/frontends/qt/GuiWorkArea.cpp