mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-13 16:29:54 +02:00
Merge branch 'master' into docking
# Conflicts: # docs/CHANGELOG.txt # examples/imgui_impl_dx10.cpp # examples/imgui_impl_dx10.h # examples/imgui_impl_dx11.cpp # examples/imgui_impl_dx11.h # examples/imgui_impl_dx12.cpp # examples/imgui_impl_dx12.h # examples/imgui_impl_dx9.cpp # examples/imgui_impl_dx9.h # examples/imgui_impl_metal.h # examples/imgui_impl_metal.mm # examples/imgui_impl_opengl3.cpp # examples/imgui_impl_opengl3.h # examples/imgui_impl_vulkan.cpp # imgui.cpp # imgui.h # imgui_internal.h
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.74 WIP
|
||||
// dear imgui, v1.74
|
||||
// (widgets code)
|
||||
|
||||
/*
|
||||
@ -2481,7 +2481,7 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
|
||||
return value_changed;
|
||||
}
|
||||
|
||||
// For 32-bits and larger types, slider bounds are limited to half the natural type range.
|
||||
// For 32-bit and larger types, slider bounds are limited to half the natural type range.
|
||||
// So e.g. an integer Slider between INT_MAX-10 and INT_MAX will fail, but an integer Slider between INT_MAX/2-10 and INT_MAX/2 will be ok.
|
||||
// It would be possible to lift that limitation with some work but it doesn't seem to be worth it for sliders.
|
||||
bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb)
|
||||
@ -3164,7 +3164,7 @@ namespace ImStb
|
||||
static int STB_TEXTEDIT_STRINGLEN(const STB_TEXTEDIT_STRING* obj) { return obj->CurLenW; }
|
||||
static ImWchar STB_TEXTEDIT_GETCHAR(const STB_TEXTEDIT_STRING* obj, int idx) { return obj->TextW[idx]; }
|
||||
static float STB_TEXTEDIT_GETWIDTH(STB_TEXTEDIT_STRING* obj, int line_start_idx, int char_idx) { ImWchar c = obj->TextW[line_start_idx + char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *GImGui; return g.Font->GetCharAdvance(c) * (g.FontSize / g.Font->FontSize); }
|
||||
static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x10000 ? 0 : key; }
|
||||
static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x200000 ? 0 : key; }
|
||||
static ImWchar STB_TEXTEDIT_NEWLINE = '\n';
|
||||
static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, STB_TEXTEDIT_STRING* obj, int line_start_idx)
|
||||
{
|
||||
@ -3347,6 +3347,10 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
|
||||
if (c >= 0xE000 && c <= 0xF8FF)
|
||||
return false;
|
||||
|
||||
// Filter Unicode ranges we are not handling in this build.
|
||||
if (c > IM_UNICODE_CODEPOINT_MAX)
|
||||
return false;
|
||||
|
||||
// Generic named filters
|
||||
if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific))
|
||||
{
|
||||
@ -3770,7 +3774,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
s += ImTextCharFromUtf8(&c, s, NULL);
|
||||
if (c == 0)
|
||||
break;
|
||||
if (c >= 0x10000 || !InputTextFilterCharacter(&c, flags, callback, callback_user_data))
|
||||
if (!InputTextFilterCharacter(&c, flags, callback, callback_user_data))
|
||||
continue;
|
||||
clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c;
|
||||
}
|
||||
@ -3994,7 +3998,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
// In multi-line mode, we never exit the loop until all lines are counted, so add one extra to the searches_remaining counter.
|
||||
searches_remaining += is_multiline ? 1 : 0;
|
||||
int line_count = 0;
|
||||
//for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++) // FIXME-OPT: Could use this when wchar_t are 16-bits
|
||||
//for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++) // FIXME-OPT: Could use this when wchar_t are 16-bit
|
||||
for (const ImWchar* s = text_begin; *s != 0; s++)
|
||||
if (*s == '\n')
|
||||
{
|
||||
@ -4071,7 +4075,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
break;
|
||||
if (rect_pos.y < clip_rect.y)
|
||||
{
|
||||
//p = (const ImWchar*)wmemchr((const wchar_t*)p, '\n', text_selected_end - p); // FIXME-OPT: Could use this when wchar_t are 16-bits
|
||||
//p = (const ImWchar*)wmemchr((const wchar_t*)p, '\n', text_selected_end - p); // FIXME-OPT: Could use this when wchar_t are 16-bit
|
||||
//p = p ? p + 1 : text_selected_end;
|
||||
while (p < text_selected_end)
|
||||
if (*p++ == '\n')
|
||||
|
Reference in New Issue
Block a user