diff options
author | Marcus Nilsson <brainbomb@gmail.com> | 2021-08-14 00:41:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-14 12:45:48 +0200 |
commit | f08069142423b0d34705895a92d4e88b429d6aeb (patch) | |
tree | b6dde74095c03f03d39e440dfa5c4aef44e5ce7e /Userland | |
parent | 1ad08ab7d64a3809f866aeb62451cc58cd8accfc (diff) | |
download | serenity-f08069142423b0d34705895a92d4e88b429d6aeb.zip |
PixelPaint: Disable context menu for GuideTool when no guide is found
Previously the context menu would popup even when closest_guide()
returned nullptr, making the Delete action do nothing.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/PixelPaint/GuideTool.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Applications/PixelPaint/GuideTool.cpp b/Userland/Applications/PixelPaint/GuideTool.cpp index 9633b47f91..de3bc85327 100644 --- a/Userland/Applications/PixelPaint/GuideTool.cpp +++ b/Userland/Applications/PixelPaint/GuideTool.cpp @@ -152,7 +152,8 @@ void GuideTool::on_context_menu(Layer&, GUI::ContextMenuEvent& event) auto image_position = editor()->editor_position_to_image_position(event.position()); m_context_menu_guide = closest_guide({ (int)image_position.x(), (int)image_position.y() }); - m_context_menu->popup(event.screen_position()); + if (m_context_menu_guide) + m_context_menu->popup(event.screen_position()); } void GuideTool::on_tool_activation() |