1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibGUI: Add TextRange::line_count()

This commit is contained in:
Sam Atkins 2023-02-23 15:18:02 +00:00 committed by Andreas Kling
parent 640f6f476c
commit 96cf9355b2
Notes: sideshowbarker 2024-07-16 23:44:30 +09:00

View file

@ -32,6 +32,8 @@ public:
TextPosition const& start() const { return m_start; }
TextPosition const& end() const { return m_end; }
size_t line_count() const { return normalized_end().line() - normalized_start().line() + 1; }
TextRange normalized() const { return TextRange(normalized_start(), normalized_end()); }
void set_start(TextPosition const& position) { m_start = position; }