From 945dbbf8070ace647bb94da16c2c9f56690287be Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 12 Apr 2023 16:57:47 +0200 Subject: a --- editor/update.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'editor') diff --git a/editor/update.cpp b/editor/update.cpp index b4c70211..5b5d6662 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -7,6 +7,7 @@ #include "floormat/main.hpp" #include "src/character.hpp" #include "src/tile-iterator.hpp" +#include "keys.hpp" #include namespace floormat { @@ -104,7 +105,9 @@ void app::do_mouse_up_down(uint8_t button, bool is_down, int mods) void app::do_mouse_scroll(int offset) { - _z_level = (int8_t)Math::clamp(_z_level + offset, 0, (int)chunk_z_max); + auto mods = get_key_modifiers(); + int min_z = mods & kmod_ctrl ? chunk_z_min : std::max(0, (int)chunk_z_min); + _z_level = (int8_t)Math::clamp(_z_level + offset, min_z, (int)chunk_z_max); } void app::do_rotate(bool backward) -- cgit v1.2.3