mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-06 13:27:47 +00:00
InputText: internals: expose LineCount, GetPreferredOffsetX().
This commit is contained in:
@@ -4206,6 +4206,7 @@ void ImGuiInputTextState::ClearSelection() { Stb->select_start
|
||||
int ImGuiInputTextState::GetCursorPos() const { return Stb->cursor; }
|
||||
int ImGuiInputTextState::GetSelectionStart() const { return Stb->select_start; }
|
||||
int ImGuiInputTextState::GetSelectionEnd() const { return Stb->select_end; }
|
||||
float ImGuiInputTextState::GetPreferredOffsetX() const { return Stb->has_preferred_x ? Stb->preferred_x : -1; }
|
||||
void ImGuiInputTextState::SelectAll() { Stb->select_start = 0; Stb->cursor = Stb->select_end = TextLen; Stb->has_preferred_x = 0; }
|
||||
void ImGuiInputTextState::ReloadUserBufAndSelectAll() { WantReloadUserBuf = true; ReloadSelectionStart = 0; ReloadSelectionEnd = INT_MAX; }
|
||||
void ImGuiInputTextState::ReloadUserBufAndKeepSelection() { WantReloadUserBuf = true; ReloadSelectionStart = Stb->select_start; ReloadSelectionEnd = Stb->select_end; }
|
||||
@@ -5269,6 +5270,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
// Store text height (note that we haven't calculated text width at all, see GitHub issues #383, #1224)
|
||||
if (is_multiline)
|
||||
text_size = ImVec2(inner_size.x, line_count * g.FontSize);
|
||||
state->LineCount = line_count;
|
||||
}
|
||||
|
||||
// Scroll
|
||||
|
||||
Reference in New Issue
Block a user