mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
Shell: Make SimpleVariable::hit_test_position not hit irrelevant offsets
Without this, any offset would be accepted as being part of the SimpleVariable. Fixes #11976 (by making it no longer crash).
This commit is contained in:
parent
3c1ca61e74
commit
2e333b3571
Notes:
sideshowbarker
2024-07-17 20:31:28 +09:00
Author: https://github.com/alimpfard
Commit: 2e333b3571
Pull-request: https://github.com/SerenityOS/serenity/pull/12044
Issue: https://github.com/SerenityOS/serenity/issues/11976
1 changed files with 3 additions and 0 deletions
|
@ -2843,6 +2843,9 @@ void SimpleVariable::highlight_in_editor(Line::Editor& editor, Shell& shell, Hig
|
|||
|
||||
HitTestResult SimpleVariable::hit_test_position(size_t offset) const
|
||||
{
|
||||
if (!position().contains(offset))
|
||||
return {};
|
||||
|
||||
if (m_slice && m_slice->position().contains(offset))
|
||||
return m_slice->hit_test_position(offset);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue