From 292244ab8fe9b4c87f5b4d827b85d9ac50589c25 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 31 Oct 2022 21:50:16 +0100 Subject: also move cursor --- editor/editor.cpp | 2 +- editor/editor.hpp | 2 +- editor/update.cpp | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/editor.cpp b/editor/editor.cpp index 7f9ba11d..04727679 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -277,7 +277,7 @@ auto editor::get_snap_value(snap_mode snap, int mods) const -> snap_mode return snap_mode::none; } -void editor::on_mouse_move(world& world, global_coords pos, int mods) +void editor::on_mouse_move(world& world, global_coords& pos, int mods) { if (!current()) return; diff --git a/editor/editor.hpp b/editor/editor.hpp index c3b4d2ec..a56e1fdb 100644 --- a/editor/editor.hpp +++ b/editor/editor.hpp @@ -86,7 +86,7 @@ struct editor final const tile_editor* current() const noexcept; void on_click(world& world, global_coords pos, int mods); - void on_mouse_move(world& world, global_coords pos, int modifiers); + void on_mouse_move(world& world, global_coords& pos, int modifiers); void on_release(); editor(); diff --git a/editor/update.cpp b/editor/update.cpp index ea3e554a..567b10e6 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -46,7 +46,10 @@ void app::do_mouse_up_down(std::uint8_t button, bool is_down, int mods) if (cursor.tile && !cursor.in_imgui && button == mouse_button_left && is_down) _editor.on_click(M->world(), *cursor.tile, mods); else + { _editor.on_release(); + update_cursor_tile(cursor.pixel); + } } void app::do_key(key k, int mods) -- cgit v1.2.3