mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 23:37:43 +00:00
LibWeb: Make selection state recomputation implicit
Add a LayoutDocument API for modifying the selection and make clients call that so we can recompute selection states automatically.
This commit is contained in:
parent
d47f77169f
commit
684fa0f99b
4 changed files with 18 additions and 8 deletions
|
@ -146,4 +146,16 @@ void LayoutDocument::recompute_selection_states()
|
|||
});
|
||||
}
|
||||
|
||||
void LayoutDocument::set_selection(const LayoutRange & selection)
|
||||
{
|
||||
m_selection = selection;
|
||||
recompute_selection_states();
|
||||
}
|
||||
|
||||
void LayoutDocument::set_selection_end(const LayoutPosition& position)
|
||||
{
|
||||
m_selection.set_end(position);
|
||||
recompute_selection_states();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue