|
@@ -3941,6 +3941,7 @@ static ImVec2 InputTextCalcTextSize(ImGuiContext* ctx, const char* text_begin, c
|
|
|
{
|
|
|
ImGuiContext& g = *ctx;
|
|
|
ImGuiInputTextState* obj = &g.InputTextState;
|
|
|
+ IM_ASSERT(text_end_display >= text_begin && text_end_display <= text_end);
|
|
|
return ImFontCalcTextSizeEx(g.Font, g.FontSize, FLT_MAX, obj->WrapWidth, text_begin, text_end_display, text_end, out_remaining, out_offset, flags);
|
|
|
}
|
|
|
|
|
@@ -4321,11 +4322,12 @@ void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, cons
|
|
|
memcpy(Buf + pos, new_text, (size_t)new_text_len * sizeof(char));
|
|
|
Buf[BufTextLen + new_text_len] = '\0';
|
|
|
|
|
|
+ BufDirty = true;
|
|
|
+ BufTextLen += new_text_len;
|
|
|
if (CursorPos >= pos)
|
|
|
CursorPos += new_text_len;
|
|
|
+ CursorPos = ImClamp(CursorPos, 0, BufTextLen);
|
|
|
SelectionStart = SelectionEnd = CursorPos;
|
|
|
- BufDirty = true;
|
|
|
- BufTextLen += new_text_len;
|
|
|
}
|
|
|
|
|
|
void ImGui::PushPasswordFont()
|