diff --git a/4ed.cpp b/4ed.cpp index 5f2a82d9..3444ebb4 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -3786,6 +3786,7 @@ App_Step_Sig(app_step){ if (i < models->layout.panel_count){ view_open_file(system, models, panel->view, filename); + view_show_file(panel->view); #if 0 if (i == 0){ if (panel->view->file_data.file){ @@ -3803,6 +3804,7 @@ App_Step_Sig(app_step){ if (i < models->layout.panel_count){ view_set_file(panel->view, models->message_buffer, models); + view_show_file(panel->view); } } diff --git a/4ed_gui.cpp b/4ed_gui.cpp index 3ff05037..2492c2fe 100644 --- a/4ed_gui.cpp +++ b/4ed_gui.cpp @@ -655,7 +655,7 @@ gui_get_scroll_vars(GUI_Target *target, GUI_id scroll_context_id, GUI_Scroll_Var result = 1; target->animating = 1; } - } + } return(result); } @@ -1213,7 +1213,7 @@ internal GUI_View_Jump gui_compute_view_jump(i32_Rect scroll_region, i32_Rect position){ GUI_View_Jump jump = {0}; i32 region_h = scroll_region.y1 - scroll_region.y0; - jump.view_min = (f32)position.y1 - region_h - scroll_region.y0; + jump.view_min = (f32)position.y1 - scroll_region.y0 - region_h; jump.view_max = (f32)position.y0 - scroll_region.y0; return(jump); } @@ -1240,8 +1240,8 @@ gui_standard_list(GUI_Target *target, GUI_id id, GUI_Scroll_Vars *vars, i32_Rect if (update->has_index_position){ GUI_View_Jump jump = gui_compute_view_jump(scroll_region, update->index_position); - jump.view_min += 45.f; - jump.view_max -= 45.f; + jump.view_min = clamp_bottom(0.f, jump.view_min + 45.f); + jump.view_max = clamp_bottom(0.f, jump.view_max - 45.f); *vars = gui_do_jump(target, jump, *vars); }