debugging scroll bar crap
parent
eda7588799
commit
efc042af3e
|
@ -3620,15 +3620,13 @@ step_file_view(System_Functions *system, View *view, b32 is_active){
|
||||||
Models *models = view->models;
|
Models *models = view->models;
|
||||||
|
|
||||||
f32 min_target_y = view->file_scroll.min_y;
|
f32 min_target_y = view->file_scroll.min_y;
|
||||||
f32 max_target_y = view->file_scroll.max_y;
|
|
||||||
|
|
||||||
b32 debug = 1;
|
|
||||||
|
|
||||||
gui_begin_top_level(target);
|
gui_begin_top_level(target);
|
||||||
{
|
{
|
||||||
gui_do_top_bar(target);
|
gui_do_top_bar(target);
|
||||||
|
|
||||||
if (debug){
|
#if 0
|
||||||
|
{
|
||||||
char prompt_space[256];
|
char prompt_space[256];
|
||||||
char text_space[256];
|
char text_space[256];
|
||||||
String prompt, text;
|
String prompt, text;
|
||||||
|
@ -3648,6 +3646,7 @@ step_file_view(System_Functions *system, View *view, b32 is_active){
|
||||||
int_to_str((int)view->gui_target.scroll_updated.target_y, &text);
|
int_to_str((int)view->gui_target.scroll_updated.target_y, &text);
|
||||||
gui_do_text_field(target, prompt, text);
|
gui_do_text_field(target, prompt, text);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (view->showing_ui == VUI_None){
|
if (view->showing_ui == VUI_None){
|
||||||
gui_begin_overlap(target);
|
gui_begin_overlap(target);
|
||||||
|
@ -3685,9 +3684,6 @@ step_file_view(System_Functions *system, View *view, b32 is_active){
|
||||||
|
|
||||||
gui_begin_scrollable(target, view->showing_ui, view->file_scroll, delta);
|
gui_begin_scrollable(target, view->showing_ui, view->file_scroll, delta);
|
||||||
|
|
||||||
if (view->file_scroll.scroll_y < min_target_y) view->file_scroll.scroll_y = min_target_y;
|
|
||||||
if (view->file_scroll.scroll_y > max_target_y) view->file_scroll.scroll_y = max_target_y;
|
|
||||||
|
|
||||||
gui_do_file(target);
|
gui_do_file(target);
|
||||||
|
|
||||||
gui_end_scrollable(target);
|
gui_end_scrollable(target);
|
||||||
|
|
10
4ed_gui.cpp
10
4ed_gui.cpp
|
@ -410,6 +410,13 @@ gui_get_scroll_vars(GUI_Target *target, u32 scroll_id, GUI_Scroll_Vars *vars_out
|
||||||
b32 result = 0;
|
b32 result = 0;
|
||||||
if (target->scroll_id == scroll_id){
|
if (target->scroll_id == scroll_id){
|
||||||
*vars_out = target->scroll_updated;
|
*vars_out = target->scroll_updated;
|
||||||
|
|
||||||
|
if (vars_out->target_y < vars_out->min_y) vars_out->target_y = vars_out->min_y;
|
||||||
|
if (vars_out->target_y > vars_out->max_y) vars_out->target_y = vars_out->max_y;
|
||||||
|
|
||||||
|
if (vars_out->scroll_y < vars_out->min_y) vars_out->scroll_y = vars_out->min_y;
|
||||||
|
if (vars_out->scroll_y > vars_out->max_y) vars_out->scroll_y = vars_out->max_y;
|
||||||
|
|
||||||
if (gui_id_eq(target->active, gui_id_scrollbar())){
|
if (gui_id_eq(target->active, gui_id_scrollbar())){
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
@ -727,6 +734,9 @@ gui_interpret(GUI_Target *target, GUI_Session *session, GUI_Header *h){
|
||||||
always_give_to_user = 1;
|
always_give_to_user = 1;
|
||||||
session->suggested_min_y = -(f32)(session->clip_rect.y0 - session->rect.y0);
|
session->suggested_min_y = -(f32)(session->clip_rect.y0 - session->rect.y0);
|
||||||
session->suggested_max_y = (f32)(session->scrollable_items_bottom - session->full_rect.y1 * .5f);
|
session->suggested_max_y = (f32)(session->scrollable_items_bottom - session->full_rect.y1 * .5f);
|
||||||
|
if (session->suggested_max_y < 0){
|
||||||
|
session->suggested_max_y = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
REM "w:\4ed\misc\build_exp.bat" /Zi
|
REM "build_exp.bat" /Zi
|
||||||
"w:\4ed\misc\build_all.bat" /DFRED_SUPER /DFRED_NOT_PACKAGE /Zi
|
"build_all.bat" /DFRED_SUPER /DFRED_NOT_PACKAGE /Zi
|
||||||
REM "w:\4ed\misc\build_all.bat" /O2 /Zi
|
REM "build_all.bat" /O2 /Zi
|
||||||
|
|
|
@ -8,7 +8,7 @@ set ICON=..\res\icon.res
|
||||||
set DEFINES=
|
set DEFINES=
|
||||||
|
|
||||||
pushd ..\meta
|
pushd ..\meta
|
||||||
cl %WARNINGOPS% ..\code\4ed_metagen.cpp /Femetagen
|
cl %OPTS% ..\code\4ed_metagen.cpp /Femetagen
|
||||||
popd
|
popd
|
||||||
pushd ..\code
|
pushd ..\code
|
||||||
"..\meta\metagen"
|
"..\meta\metagen"
|
||||||
|
@ -18,9 +18,9 @@ pushd ..\build
|
||||||
call "..\code\buildsuper.bat" ..\code\4coder_custom.cpp
|
call "..\code\buildsuper.bat" ..\code\4coder_custom.cpp
|
||||||
|
|
||||||
set EXPORTS=/EXPORT:app_get_functions
|
set EXPORTS=/EXPORT:app_get_functions
|
||||||
cl %WARNINGOPS% %INCLUDES% %DEFINES% ..\code\4ed_app_target.cpp %* /Fe4ed_app /LD /link /INCREMENTAL:NO /OPT:REF %EXPORTS%
|
cl %OPTS% %INCLUDES% %DEFINES% ..\code\4ed_app_target.cpp %* /Fe4ed_app /LD /link /INCREMENTAL:NO /OPT:REF %EXPORTS%
|
||||||
|
|
||||||
cl %WARNINGOPS% %INCLUDES% %DEFINES% ..\code\win32_4ed.cpp %LIBS% %ICON% %* /Fe4ed
|
cl %OPTS% %INCLUDES% %DEFINES% ..\code\win32_4ed.cpp %LIBS% %ICON% %* /Fe4ed
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue