diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-01 19:45:50 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-01 19:45:50 +0100 |
| commit | 472767f60387caf955d55d8a43e39e156d5e9457 (patch) | |
| tree | e4920444d18d2d43bc44fc6d15890bab882e2756 /editor/editor.hpp | |
| parent | 601c42ae7c7df2adbff931ff4ac30ba39499da69 (diff) | |
editor: improve switching snap modes
Diffstat (limited to 'editor/editor.hpp')
| -rw-r--r-- | editor/editor.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor.hpp b/editor/editor.hpp index 4d6b48df..66531814 100644 --- a/editor/editor.hpp +++ b/editor/editor.hpp @@ -88,6 +88,7 @@ struct editor final enum class button : std::uint8_t { none, place, remove, }; void on_click(world& world, global_coords pos, int mods, button b); + void on_click_(world& world, global_coords pos, int mods, button b); void on_mouse_move(world& world, global_coords& pos, int modifiers); void on_release(); @@ -102,12 +103,13 @@ struct editor final private: snap_mode get_snap_value(snap_mode snap, int mods) const; + static global_coords apply_snap(global_coords pos, global_coords last, snap_mode snap) noexcept; tile_editor _floor{ editor_mode::floor, "floor" }; tile_editor _wall { editor_mode::walls, "wall" }; struct drag_pos final { - global_coords coord; + global_coords coord, draw_coord; snap_mode snap = snap_mode::none; button btn; }; |
