mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Merge branch 'master' into docking
# Conflicts: # backends/imgui_impl_dx12.cpp # docs/CHANGELOG.txt # imgui.cpp
This commit is contained in:
commit
f9571ce4d3
14 changed files with 233 additions and 170 deletions
|
|
@ -3947,6 +3947,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);
|
||||
}
|
||||
|
||||
|
|
@ -4327,11 +4328,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';
|
||||
|
||||
if (CursorPos >= pos)
|
||||
CursorPos += new_text_len;
|
||||
SelectionStart = SelectionEnd = CursorPos;
|
||||
BufDirty = true;
|
||||
BufTextLen += new_text_len;
|
||||
if (CursorPos >= pos)
|
||||
CursorPos += new_text_len;
|
||||
CursorPos = ImClamp(CursorPos, 0, BufTextLen);
|
||||
SelectionStart = SelectionEnd = CursorPos;
|
||||
}
|
||||
|
||||
void ImGui::PushPasswordFont()
|
||||
|
|
@ -10840,8 +10842,8 @@ void ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb,
|
|||
const bool unsaved_marker_visible = (flags & ImGuiTabItemFlags_UnsavedDocument) != 0 && (button_pos.x + button_sz <= bb.Max.x) && (!close_button_visible || !is_hovered);
|
||||
if (unsaved_marker_visible)
|
||||
{
|
||||
const ImRect bullet_bb(button_pos, button_pos + ImVec2(button_sz, button_sz));
|
||||
RenderBullet(draw_list, bullet_bb.GetCenter(), GetColorU32(ImGuiCol_Text));
|
||||
ImVec2 bullet_pos = button_pos + ImVec2(button_sz, button_sz) * 0.5f;
|
||||
RenderBullet(draw_list, bullet_pos, GetColorU32(ImGuiCol_UnsavedMarker));
|
||||
}
|
||||
else if (close_button_visible)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue