diff options
author | quou <quou@disroot.org> | 2024-08-03 16:15:02 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-08-03 16:15:02 +1000 |
commit | 496db167337e246cc12beb1ace2bdec35b916479 (patch) | |
tree | c3235b99c1605f62b29bf1b4d8e36133d9f64c4b /editor.c | |
parent | ee3406af08853b0ffb30efd203a373460300077f (diff) |
scrollbars
Diffstat (limited to 'editor.c')
-rw-r--r-- | editor.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); } |