mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
WindowsServer+LibGUI: Avoid getting color under cursor outside screen
This patch fixes a crash in ColorPicker caused by the ColorSelectOverlay trying to request the color for a pixel outside the screen rect.
This commit is contained in:
parent
8515d7d5ab
commit
b46ea5158d
3 changed files with 9 additions and 4 deletions
|
@ -160,9 +160,11 @@ private:
|
|||
virtual void mousemove_event(GUI::MouseEvent&) override
|
||||
{
|
||||
auto new_col = WindowServerConnection::the().get_color_under_cursor();
|
||||
if (!new_col.has_value())
|
||||
return;
|
||||
if (new_col == m_col)
|
||||
return;
|
||||
m_col = new_col;
|
||||
m_col = new_col.value();
|
||||
if (on_color_changed)
|
||||
on_color_changed(m_col);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue