mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
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.
This commit is contained in:
parent
1ad08ab7d6
commit
f080691424
1 changed files with 2 additions and 1 deletions
|
@ -152,7 +152,8 @@ void GuideTool::on_context_menu(Layer&, GUI::ContextMenuEvent& event)
|
||||||
|
|
||||||
auto image_position = editor()->editor_position_to_image_position(event.position());
|
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_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()
|
void GuideTool::on_tool_activation()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue