summaryrefslogtreecommitdiff
path: root/src/editor.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-05-16 16:37:39 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-05-16 16:37:39 +0200
commit544f338b8e9ea010eccedbfa24bee5c97b7d3621 (patch)
tree029154f6de1a78c73a6aa9a5dfad2c16fb8928bd /src/editor.c
parentb2ca9b477856cd8ea284389b91d718e8ea814d7b (diff)
walls, msvc building
Diffstat (limited to 'src/editor.c')
-rw-r--r--src/editor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/editor.c b/src/editor.c
index 9295d14..9eee45c 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -474,12 +474,16 @@ void draw_object_panel(platform_window* window) {
int cols = 4;
int tile_w = editor_width / cols;
+ static int scroll = 0;
+ if (_global_mouse.scroll_state == SCROLL_DOWN) scroll+=10;
+ if (_global_mouse.scroll_state == SCROLL_UP) scroll-=10;
+
int tile_start = OBJECT_NONE+1;
for (int i = tile_start; i < OBJECT_END; i++) {
int x = ((i-tile_start) % cols) * tile_w;
int y = (start_y + ((i-tile_start) / cols)) * tile_w;
- y += offset_y;
+ y += offset_y + scroll;
image* img = get_image_from_objecttype((object_type)i);
if (push_icon_button(x, y, tile_w, img, object_to_place == (object_type)i)) {