move fuzzy range match visualization into formal ui rendering path; write dedicated truncated fuzzy match rendering path; fixes some visual bugs & makes all fuzzy range match visualization consistent and not ad-hoc

This commit is contained in:
Ryan Fleury
2024-02-02 15:35:44 -08:00
parent 876d9338fc
commit 708517a668
9 changed files with 102 additions and 58 deletions
+7
View File
@@ -2195,6 +2195,13 @@ ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, D_FancyRunLi
box->display_string_runs = d_fancy_run_list_copy(ui_build_arena(), runs);
}
internal inline void
ui_box_equip_fuzzy_match_ranges(UI_Box *box, FuzzyMatchRangeList *matches)
{
box->flags |= UI_BoxFlag_HasFuzzyMatchRanges;
box->fuzzy_match_ranges = fuzzy_match_range_list_copy(ui_build_arena(), matches);
}
internal void
ui_box_equip_draw_bucket(UI_Box *box, D_Bucket *bucket)
{
+4 -2
View File
@@ -235,7 +235,8 @@ typedef U64 UI_BoxFlags;
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<44)
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<45)
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<46)
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<47)
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<47)
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<48)
//- rjf: bundles
# define UI_BoxFlag_Clickable (UI_BoxFlag_MouseClickable|UI_BoxFlag_KeyboardClickable)
@@ -294,7 +295,7 @@ struct UI_Box
Rng2F32 rect;
Vec2F32 fixed_position_animated;
Vec2F32 position_delta;
U64 num_focus_children;
FuzzyMatchRangeList fuzzy_match_ranges;
//- rjf: persistent data
U64 first_touched_build_index;
@@ -605,6 +606,7 @@ internal UI_Box * ui_build_box_from_stringf(UI_BoxFlags flags, char *fm
internal inline void ui_box_equip_display_string(UI_Box *box, String8 string);
internal inline void ui_box_equip_display_fancy_strings(UI_Box *box, D_FancyStringList *strings);
internal inline void ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, D_FancyRunList *runs);
internal inline void ui_box_equip_fuzzy_match_ranges(UI_Box *box, FuzzyMatchRangeList *matches);
internal inline void ui_box_equip_draw_bucket(UI_Box *box, D_Bucket *bucket);
internal inline void ui_box_equip_custom_draw(UI_Box *box, UI_BoxCustomDrawFunctionType *custom_draw, void *user_data);