fixed issue with scroll controling in GUI lists

master
Allen Webster 2016-06-03 09:40:05 -04:00
parent f3370cfc2e
commit 4dd5d1bfa0
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -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);
}