浏览代码

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.
Torstennator 1 年之前
父节点
当前提交
c74e2d04d1
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Userland/Applications/PixelPaint/ImageEditor.cpp

+ 3 - 0
Userland/Applications/PixelPaint/ImageEditor.cpp

@@ -430,6 +430,9 @@ void ImageEditor::mousemove_event(GUI::MouseEvent& event)
         return;
         return;
     }
     }
 
 
+    if (active_tool() == nullptr)
+        return;
+
     auto image_event = event_with_pan_and_scale_applied(event);
     auto image_event = event_with_pan_and_scale_applied(event);
     if (on_image_mouse_position_change) {
     if (on_image_mouse_position_change) {
         on_image_mouse_position_change(image_event.position());
         on_image_mouse_position_change(image_event.position());