mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibWeb: Add LayoutRange::normalized()
We use this to ensure that we're always working with a selection where the start() is before the end() in document order. That simplifies all the logic around this.
This commit is contained in:
@@ -97,7 +97,7 @@ int LineBoxFragment::text_index_at(float x) const
|
||||
|
||||
Gfx::FloatRect LineBoxFragment::selection_rect(const Gfx::Font& font) const
|
||||
{
|
||||
auto& selection = layout_node().root().selection();
|
||||
auto selection = layout_node().root().selection().normalized();
|
||||
if (!selection.is_valid())
|
||||
return {};
|
||||
if (!layout_node().is_text())
|
||||
|
||||
Reference in New Issue
Block a user