Fixed endless animation in UI mode

This commit is contained in:
Allen Webster 2018-10-09 16:51:45 -07:00
parent 8f80316e10
commit 29fc6f84c6
6 changed files with 24 additions and 16 deletions

View File

@ -109,9 +109,9 @@ CUSTOM_DOC("At the cursor, insert a block comment.")
} }
CUSTOM_COMMAND_SIG(write_zero_struct) CUSTOM_COMMAND_SIG(write_zero_struct)
CUSTOM_DOC("At the cursor, insert a ' = {0};'.") CUSTOM_DOC("At the cursor, insert a ' = {};'.")
{ {
write_string(app, make_lit_string(" = {0};")); write_string(app, make_lit_string(" = {};"));
} }
//////////////////////////////// ////////////////////////////////

View File

@ -452,7 +452,7 @@ static Command_Metadata fcoder_metacmd_table[216] = {
{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 99 }, { PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 99 },
{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 87 }, { PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 87 },
{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 49 }, { PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 49 },
{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {0};'.", 34, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 111 }, { PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 111 },
}; };
static int32_t fcoder_metacmd_ID_allow_mouse = 0; static int32_t fcoder_metacmd_ID_allow_mouse = 0;
static int32_t fcoder_metacmd_ID_auto_tab_line_at_cursor = 1; static int32_t fcoder_metacmd_ID_auto_tab_line_at_cursor = 1;

View File

@ -1199,12 +1199,11 @@ App_Step_Sig(app_step){
} }
// NOTE(allen): reorganizing panels on screen // NOTE(allen): reorganizing panels on screen
{
i32 prev_width = models->layout.full_width; i32 prev_width = models->layout.full_width;
i32 prev_height = models->layout.full_height; i32 prev_height = models->layout.full_height;
i32 current_width = target->width; i32 current_width = target->width;
i32 current_height = target->height; i32 current_height = target->height;
{
models->layout.full_width = current_width; models->layout.full_width = current_width;
models->layout.full_height = current_height; models->layout.full_height = current_height;
@ -1244,9 +1243,13 @@ App_Step_Sig(app_step){
} }
if (input->mouse.x != models->prev_x || input->mouse.y != models->prev_y){ if (input->mouse.x != models->prev_x || input->mouse.y != models->prev_y){
b32 was_in_window = hit_check(models->prev_x, models->prev_y, i32R(0, 0, prev_width, prev_height));
b32 is_in_window = hit_check(input->mouse.x, input->mouse.y, i32R(0, 0, current_width, current_height));
if (is_in_window || (was_in_window != is_in_window)){
mouse_event.keycode = key_mouse_move; mouse_event.keycode = key_mouse_move;
input->keys.keys[input->keys.count++] = mouse_event; input->keys.keys[input->keys.count++] = mouse_event;
} }
}
if (models->animated_last_frame){ if (models->animated_last_frame){
mouse_event.keycode = key_animate; mouse_event.keycode = key_animate;
@ -1682,8 +1685,10 @@ App_Step_Sig(app_step){
models->prev_command = cmd_bind; models->prev_command = cmd_bind;
if (key.keycode == key_animate){
app_result.animating = true; app_result.animating = true;
} }
}
}break; }break;
case APP_STATE_RESIZING: case APP_STATE_RESIZING:

View File

@ -591,9 +591,11 @@ hsla_to_rgba(Vec4 hsla){
internal i32_Rect internal i32_Rect
i32R(int32_t l, int32_t t, int32_t r, int32_t b){ i32R(int32_t l, int32_t t, int32_t r, int32_t b){
i32_Rect rect; i32_Rect rect = {0};
rect.x0 = l; rect.y0 = t; rect.x0 = l;
rect.x1 = r; rect.y1 = b; rect.y0 = t;
rect.x1 = r;
rect.y1 = b;
return(rect); return(rect);
} }

View File

@ -11,8 +11,9 @@
Bugs Bugs
{ {
[x] Crash when freeing marker object without visuals [x] Crash when freeing marker object without visuals
[] High CPU usage in listers [x] High CPU usage in listers
[] Panel resizing doesn't work [] Panel resizing doesn't work
[] Double free crash for markers object (not invaliding managed objects correctly?)
[] Notepad like mode clicking to new view doesn't snap the mark [] Notepad like mode clicking to new view doesn't snap the mark
[] Notepad like mode replacing text with cursor at end of selection in middle of long file [] Notepad like mode replacing text with cursor at end of selection in middle of long file
[] Tab when no valid completions in open file lister [] Tab when no valid completions in open file lister