mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Added Dummy() helper
This commit is contained in:
16
imgui.cpp
16
imgui.cpp
@ -7472,16 +7472,22 @@ void ImGui::Separator()
|
||||
}
|
||||
}
|
||||
|
||||
// A little vertical spacing.
|
||||
void ImGui::Spacing()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
if (window->SkipItems)
|
||||
return;
|
||||
|
||||
ItemSize(ImVec2(0,0));
|
||||
}
|
||||
|
||||
void ImGui::Dummy(const ImVec2& size)
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
if (window->SkipItems)
|
||||
return;
|
||||
ItemSize(size);
|
||||
}
|
||||
|
||||
// Advance cursor given item size.
|
||||
static void ItemSize(ImVec2 size, float text_offset_y)
|
||||
{
|
||||
@ -10463,6 +10469,12 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
// Dummy
|
||||
ImVec2 sz(30,30);
|
||||
ImGui::Button("A", sz); ImGui::SameLine();
|
||||
ImGui::Dummy(sz); ImGui::SameLine();
|
||||
ImGui::Button("B", sz);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user