mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00:00
PixelPaint: Disable current tool when color picking using the Alt key
This commit is contained in:
parent
2f5bbc68ed
commit
06e09cf415
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/tcl3
Commit: 06e09cf415
Pull-request: https://github.com/SerenityOS/serenity/pull/17084
1 changed files with 6 additions and 4 deletions
|
@ -391,6 +391,8 @@ void ImageEditor::mousedown_event(GUI::MouseEvent& event)
|
|||
|
||||
void ImageEditor::doubleclick_event(GUI::MouseEvent& event)
|
||||
{
|
||||
if (!m_active_tool || (event.alt() && !m_active_tool->is_overriding_alt()))
|
||||
return;
|
||||
auto layer_event = m_active_layer ? event_adjusted_for_layer(event, *m_active_layer) : event;
|
||||
auto image_event = event_with_pan_and_scale_applied(event);
|
||||
Tool::MouseEvent tool_event(Tool::MouseEvent::Action::DoubleClick, layer_event, image_event, event);
|
||||
|
@ -410,14 +412,14 @@ void ImageEditor::mousemove_event(GUI::MouseEvent& event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!m_active_tool)
|
||||
return;
|
||||
|
||||
auto image_event = event_with_pan_and_scale_applied(event);
|
||||
if (on_image_mouse_position_change) {
|
||||
on_image_mouse_position_change(image_event.position());
|
||||
}
|
||||
|
||||
if (!m_active_tool || (event.alt() && !m_active_tool->is_overriding_alt()))
|
||||
return;
|
||||
|
||||
auto layer_event = m_active_layer ? event_adjusted_for_layer(event, *m_active_layer) : event;
|
||||
Tool::MouseEvent tool_event(Tool::MouseEvent::Action::MouseDown, layer_event, image_event, event);
|
||||
m_active_tool->on_mousemove(m_active_layer.ptr(), tool_event);
|
||||
|
@ -433,7 +435,7 @@ void ImageEditor::mouseup_event(GUI::MouseEvent& event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!m_active_tool)
|
||||
if (!m_active_tool || (event.alt() && !m_active_tool->is_overriding_alt()))
|
||||
return;
|
||||
auto layer_event = m_active_layer ? event_adjusted_for_layer(event, *m_active_layer) : event;
|
||||
auto image_event = event_with_pan_and_scale_applied(event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue