summaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/editor.c b/editor.c
index 0aae694..b59ce32 100644
--- a/editor.c
+++ b/editor.c
@@ -12,18 +12,22 @@ void draw_map_scrollable(
const Rect* rect,
const GUI_Scroll_State* ss
) {
+ Rect re = { 0, 0, 500, 500 };
+ re.x = rect->x - ss->x;
+ re.y = rect->y - ss->y;
(void)g;
(void)ss;
- ren_texture(r, rect, get_texture(asset_id_floorboards_texture));
+ ren_texture(r, &re, get_texture(asset_id_floorboards_texture));
}
void edit_map(Editor* e, GUI* g, Map* m) {
Rect b = gui_viewport(g);
Rect t = gui_cut_up(&b, gui_text_height() + 4);
+ int mcs[] = { 500, 500 };
(void)e;
(void)m;
gui_btn(g, gui_cut_left(&t, gui_text_width("Load", 4) + 4), "Save");
gui_btn(g, gui_cut_left(&t, gui_text_width("Save", 4) + 4), "Load");
- gui_scrollable(g, b, &map_ss, draw_map_scrollable);
+ gui_scrollable(g, b, mcs, &map_ss, draw_map_scrollable);
}