PixelPaint: Set initial position correctly when using the move tool

This fixes an issue, where single clicking in the corner of the image
without moving the mouse would cause the layer to jump to the top left
corner of the canvas.
This commit is contained in:
Tim Ledbetter 2023-01-27 22:00:09 +00:00 committed by Andreas Kling
parent 403c0e6dab
commit 7b3bc883f1

View file

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
* Copyright (c) 2022-2023, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -41,7 +41,7 @@ void MoveTool::on_mousedown(Layer* layer, MouseEvent& event)
m_layer_being_moved = *layer;
m_event_origin = image_event.position();
m_layer_origin = layer->location();
m_new_layer_rect = m_editor->active_layer()->rect();
m_new_layer_rect = m_editor->active_layer()->relative_rect();
}
void MoveTool::on_mousemove(Layer* layer, MouseEvent& event)