mirror of
https://github.com/ocornut/imgui.git
synced 2026-09-26 16:05:45 +03:00
ImGuiTextFilter: added undocumented MinWordSize support. (#2435)
This commit is contained in:
parent
c74e7e93a3
commit
c0041b7d3c
2 changed files with 3 additions and 1 deletions
|
|
@ -3094,6 +3094,7 @@ IM_MSVC_RUNTIME_CHECKS_RESTORE
|
|||
ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) //-V1077
|
||||
{
|
||||
InputBuf[0] = 0;
|
||||
MinWordSize = 1;
|
||||
_CountInclude = 0;
|
||||
if (default_filter)
|
||||
{
|
||||
|
|
@ -3127,7 +3128,7 @@ static void ImGuiTextFilter_BuildAddItem(ImGuiTextFilter* f, const char* word_b,
|
|||
word_e--;
|
||||
}
|
||||
const bool is_excl = (word_b < word_e && word_b[0] == '-');
|
||||
if (word_e - word_b - (is_excl ? 1 : 0) <= 0)
|
||||
if (word_e - word_b - (is_excl ? 1 : 0) < f->MinWordSize)
|
||||
return;
|
||||
|
||||
// Add to list
|
||||
|
|
|
|||
1
imgui.h
1
imgui.h
|
|
@ -2811,6 +2811,7 @@ struct ImGuiTextFilter
|
|||
|
||||
// [Internal] Members
|
||||
char InputBuf[256]; // User input buffer
|
||||
ImU8 MinWordSize; // == 1
|
||||
int _CountInclude; // >= 0
|
||||
ImVector<ImGuiTextFilterItem> _Items; // Pre-parsed, trimmed, reordered items
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue