Jean-Marc Lasgouttes e5aaa64b63 Improve the code that limits scrolling at top/bottom
The most visible part of this commit is the move of part of
BufferView::updateMetrics to a new TextMetrics::updateMetrics. This
new method makes sure that metrics are known for all visible paragraphs
(starting from anchor), and that the positions of the paragraphs have
been recorded.

This method is called up to 3 times in BufferView::updateMetrics:
* unconditionally, to update all visible metrics,
* then, if the bottom of the document is visible and too high, after
  updating the anchor ypos,
* and similarly if the top of the document is visible and too low.

This fixes for example the case where one jumps to Section 5.3 at the
end of Tutorial and 'scroll_below_document' is false.

Some now redundant code is removed from BufferView::scrollToCursor.

The anchor-setting code in BufferView::draw is not clearly useful, but
left here just in case. It generates a debug warning, though.

Part of bug #12297.

(cherry picked from commit f15d2ebf3819913114ab93d1ff7e140cb26b03d5)
2024-04-18 16:45:58 +02:00
..
2024-04-01 17:59:56 +02:00
2022-12-28 12:57:45 +01:00
2024-03-01 13:45:28 +01:00
2024-03-01 13:45:28 +01:00
2024-01-11 17:23:52 -05:00
2024-04-18 16:45:58 +02:00
2022-03-05 13:45:27 +01:00
2022-11-27 13:20:17 -05:00
2023-10-04 13:10:07 +02:00
2023-10-04 13:10:07 +02:00
2022-11-27 13:20:17 -05:00
2022-11-27 13:20:17 -05:00
2023-09-23 16:18:28 +02:00
2023-07-27 22:39:49 +02:00
2023-07-29 14:41:22 -04:00
2023-10-04 13:49:34 +02:00
2023-09-30 20:20:03 -04:00
2022-03-06 23:01:56 +01:00
2022-10-31 06:51:38 +01:00
2022-02-27 14:53:01 +01:00
2023-09-30 13:44:03 +02:00
2021-01-10 00:43:01 -05:00
2023-01-14 10:45:57 +01:00
2022-12-19 15:15:41 +01:00
2023-02-22 16:33:37 +01:00
2022-10-26 10:52:21 +02:00
2022-10-26 10:52:21 +02:00
2023-08-16 17:51:55 -04:00
2024-03-31 12:40:27 +02:00
2021-10-15 18:13:09 +02:00
2022-10-26 10:52:21 +02:00
2022-10-26 10:52:21 +02:00
2022-10-26 10:52:21 +02:00
2022-10-26 10:52:21 +02:00
2021-01-14 01:15:19 -05:00
2022-10-26 10:52:21 +02:00
2023-07-28 10:31:54 +02:00
2021-10-21 16:01:57 +02:00
2022-10-26 10:52:21 +02:00