From 3ec6d11230deddb8c2de6b3978bbb0bf38934bbf Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Mon, 3 Feb 2020 16:20:22 -0800 Subject: [PATCH] Fix rare infinite loop in layout of code files --- custom/4coder_layout_rule.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/custom/4coder_layout_rule.cpp b/custom/4coder_layout_rule.cpp index ce9e5aec..d83e3836 100644 --- a/custom/4coder_layout_rule.cpp +++ b/custom/4coder_layout_rule.cpp @@ -17,6 +17,7 @@ get_layout_reflex(Layout_Item_List *list, Buffer_ID buffer, f32 width, Face_ID f function Rect_f32 layout_reflex_get_rect(Application_Links *app, Layout_Reflex *reflex, i64 pos, b32 *unresolved_dependence){ Rect_f32 rect = {}; + pos = clamp_bot(0, pos); if (range_contains(reflex->list->input_index_range, pos)){ if (range_contains(reflex->list->manifested_index_range, pos)){ rect = layout_box_of_pos(*reflex->list, pos);