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:
parent
640f6f476c
commit
96cf9355b2
Notes:
sideshowbarker
2024-07-16 23:44:30 +09:00
Author: https://github.com/AtkinsSJ
Commit: 96cf9355b2
Pull-request: https://github.com/SerenityOS/serenity/pull/17581
Reviewed-by: https://github.com/alimpfard
1 changed files with 2 additions and 0 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue