mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb: Extend text selection when left clicking and holding shift
This commit is contained in:
@@ -433,8 +433,12 @@ bool EventHandler::handle_mousedown(CSSPixelPoint viewport_position, CSSPixelPoi
|
||||
auto& realm = document->realm();
|
||||
m_navigable->set_cursor_position(DOM::Position::create(realm, *paintable->dom_node(), result->index_in_node));
|
||||
if (auto selection = document->get_selection()) {
|
||||
if (modifiers & KeyModifier::Mod_Shift) {
|
||||
(void)selection->set_base_and_extent(*selection->anchor_node(), selection->anchor_offset(), *paintable->dom_node(), result->index_in_node);
|
||||
} else {
|
||||
(void)selection->set_base_and_extent(*paintable->dom_node(), result->index_in_node, *paintable->dom_node(), result->index_in_node);
|
||||
}
|
||||
}
|
||||
m_in_mouse_selection = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user