From 0ae66f5cddd75ffe1e0203cc299a6871d4c3d85f Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 20 May 2016 13:45:38 -0400 Subject: [PATCH] another issue with new scroll-cursor tracking fixed --- 4ed.cpp | 14 +++++++------- 4ed_file_view.cpp | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/4ed.cpp b/4ed.cpp index 79b9e9ab..2435fa0f 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -4554,23 +4554,23 @@ App_Step_Sig(app_step){ { View *view = 0; Panel *panel = 0, *used_panels = 0; - i32 cursor_view_state = 0; + i32 cursor_scroll_state = 0; used_panels = &models->layout.used_sentinel; for (dll_items(panel, used_panels)){ view = panel->view; - cursor_view_state = view_get_cursor_view_change_state(view); + cursor_scroll_state = view_get_cursor_scroll_change_state(view); - switch (cursor_view_state){ - case CursorView_NoChange:break; + switch (cursor_scroll_state){ + case CursorScroll_NoChange:break; - case CursorView_Cursor: - case CursorView_Both: + case CursorScroll_Cursor: + case CursorScroll_Both: view_move_view_to_cursor(view); break; - case CursorView_View: + case CursorScroll_Scroll: gui_post_scroll_vars(&view->gui_target, view->current_scroll); break; } diff --git a/4ed_file_view.cpp b/4ed_file_view.cpp index 300d91a2..ea13c839 100644 --- a/4ed_file_view.cpp +++ b/4ed_file_view.cpp @@ -262,14 +262,14 @@ view_lock_level(View *view){ inline f32 view_file_width(View *view){ - i32_Rect file_rect = view->scroll_region; + i32_Rect file_rect = view->file_region; f32 result = (f32)(file_rect.x1 - file_rect.x0); return (result); } inline f32 view_file_height(View *view){ - i32_Rect file_rect = view->scroll_region; + i32_Rect file_rect = view->file_region; f32 result = (f32)(file_rect.y1 - file_rect.y0); return (result); } @@ -3189,15 +3189,15 @@ view_move_view_to_cursor(View *view){ } } -enum CursorView_State{ - CursorView_NoChange, - CursorView_Cursor, - CursorView_View, - CursorView_Both +enum CursorScroll_State{ + CursorScroll_NoChange, + CursorScroll_Cursor, + CursorScroll_Scroll, + CursorScroll_Both }; internal i32 -view_get_cursor_view_change_state(View *view){ +view_get_cursor_scroll_change_state(View *view){ i32 result = 0; b32 cursor_change = 0; b32 view_change = 0; @@ -3216,18 +3216,18 @@ view_get_cursor_view_change_state(View *view){ if (cursor_change){ if (view_change){ - result = CursorView_Both; + result = CursorScroll_Both; } else{ - result = CursorView_Cursor; + result = CursorScroll_Cursor; } } else{ if (view_change){ - result = CursorView_View; + result = CursorScroll_Scroll; } else{ - result = CursorView_NoChange; + result = CursorScroll_NoChange; } } @@ -3237,7 +3237,7 @@ view_get_cursor_view_change_state(View *view){ internal void view_record_prev_cursor(View *view){ if (view->gui_target.did_file){ - view->prev_cursor_pos = view->file_data.cursor.pos; + view->prev_cursor_pos = view_get_cursor_pos(view); } }