1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

PixelPaint: Rename original_event => image_event

These events are in image coordinates, not really original coordinates.
This commit is contained in:
Andreas Kling 2020-05-21 21:57:57 +02:00
parent 45dfa094e9
commit 84b508befa
11 changed files with 32 additions and 32 deletions

View file

@ -43,23 +43,23 @@ MoveTool::~MoveTool()
{
}
void MoveTool::on_mousedown(Layer& layer, GUI::MouseEvent& event, GUI::MouseEvent& original_event)
void MoveTool::on_mousedown(Layer& layer, GUI::MouseEvent& event, GUI::MouseEvent& image_event)
{
if (event.button() != GUI::MouseButton::Left)
return;
if (!layer.rect().contains(event.position()))
return;
m_layer_being_moved = layer;
m_event_origin = original_event.position();
m_event_origin = image_event.position();
m_layer_origin = layer.location();
m_editor->window()->set_override_cursor(GUI::StandardCursor::Move);
}
void MoveTool::on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent& original_event)
void MoveTool::on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent& image_event)
{
if (!m_layer_being_moved)
return;
auto delta = original_event.position() - m_event_origin;
auto delta = image_event.position() - m_event_origin;
m_layer_being_moved->set_location(m_layer_origin.translated(delta));
m_editor->layers_did_change();
}