summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-01 16:50:21 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-01 16:50:21 +0100
commit691bcad96ad68c215f4956e376e0391c553139c9 (patch)
tree89a6770c92cfee9d49dfe4bee139592792f8deff
parenta48aa90f70c4be147e69b754483c7886db6d2ee0 (diff)
fix keybindings
-rw-r--r--editor/editor.cpp1
-rw-r--r--editor/events.cpp7
2 files changed, 5 insertions, 3 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index 3d2ee3a6..011cdc18 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -153,7 +153,6 @@ tile_image_proto tile_editor::get_selected()
void tile_editor::place_tile(world& world, global_coords pos, const tile_image_proto& img)
{
auto [c, t] = world[pos];
- const auto& [atlas, variant] = img;
switch (_mode)
{
case editor_mode::none:
diff --git a/editor/events.cpp b/editor/events.cpp
index 3c6268ee..86ff4d59 100644
--- a/editor/events.cpp
+++ b/editor/events.cpp
@@ -72,14 +72,17 @@ void app::on_mouse_up_down(const mouse_button_event& event, bool is_down) noexce
Right = mouse_button_right,
Middle = mouse_button_middle,
};
+
+ const auto button = std::uint8_t(1 << (event.button-1));
+
struct ev {
using Button = Button;
accessor(Vector2i, position)
accessor(Button, button)
- } e = {event.position, Button(event.button)};
+ } e = {event.position, Button(button)};
if (!(cursor.in_imgui = is_down ? _imgui.handleMousePressEvent(e) : _imgui.handleMouseReleaseEvent(e)))
- do_mouse_up_down(event.button, is_down, fixup_mods(event.mods));
+ do_mouse_up_down(button, is_down, fixup_mods(event.mods));
}
void app::on_mouse_scroll(const mouse_scroll_event& event) noexcept