summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-12 16:57:47 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-12 16:57:47 +0200
commit945dbbf8070ace647bb94da16c2c9f56690287be (patch)
treedfaea763a7e3c6abd0d37fd6de6b1532ca4c5c48 /editor
parent506f87c554153eb0bbc3bc9e4fb0f26792f8bfca (diff)
a
Diffstat (limited to 'editor')
-rw-r--r--editor/update.cpp5
1 files changed, 4 insertions, 1 deletions
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 <cmath>
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)