mirror of
https://github.com/Drezil/imgui.git
synced 2025-03-31 16:32:45 +00:00
ImGuITextFilter::Draw() use regular width call.
This commit is contained in:
parent
dbdbaec3eb
commit
941ef993d9
@ -1269,13 +1269,10 @@ ImGuiTextFilter::ImGuiTextFilter()
|
|||||||
void ImGuiTextFilter::Draw(const char* label, float width)
|
void ImGuiTextFilter::Draw(const char* label, float width)
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = GetCurrentWindow();
|
ImGuiWindow* window = GetCurrentWindow();
|
||||||
if (width < 0.0f)
|
if (width > 0.0f)
|
||||||
{
|
|
||||||
ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
|
|
||||||
width = ImMax(window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x - (label_size.x + GImGui->Style.ItemSpacing.x*4), 10.0f);
|
|
||||||
}
|
|
||||||
ImGui::PushItemWidth(width);
|
ImGui::PushItemWidth(width);
|
||||||
ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf));
|
ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf));
|
||||||
|
if (width > 0.0f)
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
Build();
|
Build();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user