From 45e60a416b36b9620196964a3840ff3aa2c6fc8c Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Wed, 18 Jan 2023 18:35:17 +0000 Subject: [PATCH] PixelPaint: Use layer coordinates when color picking using Alt key Previously, raw coordinates were being used, which meant that color was being sampled from the wrong position. --- Userland/Applications/PixelPaint/ImageEditor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index b677b2a93a..8ee9b0f6ec 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -370,11 +370,6 @@ void ImageEditor::mousedown_event(GUI::MouseEvent& event) return; } - if (event.alt() && !m_active_tool->is_overriding_alt()) { - set_editor_color_to_color_at_mouse_position(event); - return; // Pick Color instead of acivating active tool when holding alt. - } - if (!m_active_tool) return; @@ -384,6 +379,11 @@ void ImageEditor::mousedown_event(GUI::MouseEvent& event) } auto layer_event = m_active_layer ? event_adjusted_for_layer(event, *m_active_layer) : event; + if (event.alt() && !m_active_tool->is_overriding_alt()) { + set_editor_color_to_color_at_mouse_position(layer_event); + return; // Pick Color instead of acivating active tool when holding alt. + } + auto image_event = event_with_pan_and_scale_applied(event); Tool::MouseEvent tool_event(Tool::MouseEvent::Action::MouseDown, layer_event, image_event, event); m_active_tool->on_mousedown(m_active_layer.ptr(), tool_event);