summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/TextNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/TextNode.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Layout/TextNode.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TextNode.cpp b/Userland/Libraries/LibWeb/Layout/TextNode.cpp
index 7cee023604..e2f6783e31 100644
--- a/Userland/Libraries/LibWeb/Layout/TextNode.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TextNode.cpp
@@ -86,7 +86,8 @@ void TextNode::paint_cursor_if_needed(PaintContext& context, const LineBoxFragme
if (frame().cursor_position().node() != &dom_node())
return;
- if (!(frame().cursor_position().offset() >= (unsigned)fragment.start() && frame().cursor_position().offset() < (unsigned)(fragment.start() + fragment.length())))
+ // NOTE: This checks if the cursor is before the start or after the end of the fragment. If it is at the end, after all text, it should still be painted.
+ if (frame().cursor_position().offset() < (unsigned)fragment.start() || frame().cursor_position().offset() > (unsigned)(fragment.start() + fragment.length()))
return;
if (!fragment.layout_node().dom_node() || !fragment.layout_node().dom_node()->is_editable())