From c74e2d04d137fe0b9aeb14e87f6aa2baf5da3a4a Mon Sep 17 00:00:00 2001 From: Torstennator Date: Mon, 11 Dec 2023 19:57:21 +0100 Subject: [PATCH] PixelPaint: Fix crash on mouse moves This pr fixes a problem where the application would crash if the mouse was moved while the editor was still loading the image. With this change tool related mouse move events are discarded as long as there is no active tool. --- Userland/Applications/PixelPaint/ImageEditor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index 1cbf8505af..42c9e22193 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -430,6 +430,9 @@ void ImageEditor::mousemove_event(GUI::MouseEvent& event) return; } + if (active_tool() == nullptr) + 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());