From 9bb9cb3f962bea7365e21bb1a836bf140deb6570 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 4 Aug 2024 00:32:05 +0200 Subject: Optimize Fl_Text_Display scrolling speed (#596). --- FL/Fl_Text_Buffer.H | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'FL') diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H index fa3916eba..6d59e9adf 100644 --- a/FL/Fl_Text_Buffer.H +++ b/FL/Fl_Text_Buffer.H @@ -635,6 +635,13 @@ public: */ int count_lines(int startPos, int endPos) const; + /** + Estimate the number of newlines between \p startPos and \p endPos in buffer. + This call takes line wrapping into account. It assumes a line break at every + `lineLen` characters after the beginning of a line. + */ + int estimate_lines(int startPos, int endPos, int lineLen) const; + /** Finds the first character of the line \p nLines forward from \p startPos in the buffer and returns its position. -- cgit v1.2.3