diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-31 21:50:16 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-31 21:50:16 +0100 |
commit | 292244ab8fe9b4c87f5b4d827b85d9ac50589c25 (patch) | |
tree | 9a985dabe4fc306d55e46eec73ffb0db402675ec | |
parent | 7eb0e9ac4d7c5daff5698286ed73f5ca1db33c32 (diff) |
also move cursor
-rw-r--r-- | editor/editor.cpp | 2 | ||||
-rw-r--r-- | editor/editor.hpp | 2 | ||||
-rw-r--r-- | 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) |