]> git.lyx.org Git - lyx.git/commit
Streamline BufferView::scrollToCursor
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 3 Sep 2024 14:21:32 +0000 (16:21 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 3 Sep 2024 15:45:48 +0000 (17:45 +0200)
commitf52842d289d1434c44ffb4c9971279a8e56af612
treed787b9875a0a121da9119d08759bb06e46045ed1
parent86d2313ce323fd20fadd63f103625e15704ae527
Streamline BufferView::scrollToCursor

There are two parts in this patch :

1/ in the part where the cursor is already visible, replace calls to
scroll/scrollUp/scrollDown by direct manipulation of the anchor
vertical position. Reasoning in terms of new position rather than
amount of pixels to scroll makes work easier.

2/ in the part where the cursor is set to a new TOP or CENTER
position, move the code around in order to prepare for new ScrollType
enums.

No change intended, except that CENTER now relies on the contents
dimension of the row that holds the iterator, that is without spacing
and labels.
src/BufferView.cpp