mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
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:
parent
403c0e6dab
commit
7b3bc883f1
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue