mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-06 22:34:24 +01:00
BeginGroup() extra comment because this is overused and misleading (#608)
This commit is contained in:
parent
919eb69931
commit
4b51e43d60
@ -8813,6 +8813,7 @@ bool ImGui::IsRectVisible(const ImVec2& size)
|
|||||||
return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size));
|
return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lock horizontal starting position + EndGroup() wraps group bounding box into one "item" (so you can use IsItemHovered() on a group, SameLine() between groups, etc.)
|
||||||
void ImGui::BeginGroup()
|
void ImGui::BeginGroup()
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = GetCurrentWindow();
|
ImGuiWindow* window = GetCurrentWindow();
|
||||||
@ -9056,7 +9057,6 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
|||||||
{
|
{
|
||||||
if (g.ActiveIdIsJustActivated)
|
if (g.ActiveIdIsJustActivated)
|
||||||
g.ActiveClickDeltaToCenter.x = x - g.IO.MousePos.x;
|
g.ActiveClickDeltaToCenter.x = x - g.IO.MousePos.x;
|
||||||
|
|
||||||
x = GetDraggedColumnOffset(i);
|
x = GetDraggedColumnOffset(i);
|
||||||
SetColumnOffset(i, x);
|
SetColumnOffset(i, x);
|
||||||
}
|
}
|
||||||
|
4
imgui.h
4
imgui.h
@ -187,14 +187,14 @@ namespace ImGui
|
|||||||
IMGUI_API void PopButtonRepeat();
|
IMGUI_API void PopButtonRepeat();
|
||||||
|
|
||||||
// Cursor / Layout
|
// Cursor / Layout
|
||||||
IMGUI_API void BeginGroup(); // lock horizontal starting position. once closing a group it is seen as a single item (so you can use IsItemHovered() on a group, SameLine() between groups, etc.
|
|
||||||
IMGUI_API void EndGroup();
|
|
||||||
IMGUI_API void Separator(); // horizontal line
|
IMGUI_API void Separator(); // horizontal line
|
||||||
IMGUI_API void SameLine(float pos_x = 0.0f, float spacing_w = -1.0f); // call between widgets or groups to layout them horizontally
|
IMGUI_API void SameLine(float pos_x = 0.0f, float spacing_w = -1.0f); // call between widgets or groups to layout them horizontally
|
||||||
IMGUI_API void Spacing(); // add spacing
|
IMGUI_API void Spacing(); // add spacing
|
||||||
IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size
|
IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size
|
||||||
IMGUI_API void Indent(); // move content position toward the right by style.IndentSpacing pixels
|
IMGUI_API void Indent(); // move content position toward the right by style.IndentSpacing pixels
|
||||||
IMGUI_API void Unindent(); // move content position back to the left (cancel Indent)
|
IMGUI_API void Unindent(); // move content position back to the left (cancel Indent)
|
||||||
|
IMGUI_API void BeginGroup(); // lock horizontal starting position + EndGroup() wraps group bounding box into one "item" (so you can use IsItemHovered() on a group, SameLine() between groups, etc.)
|
||||||
|
IMGUI_API void EndGroup();
|
||||||
IMGUI_API ImVec2 GetCursorPos(); // cursor position is relative to window position
|
IMGUI_API ImVec2 GetCursorPos(); // cursor position is relative to window position
|
||||||
IMGUI_API float GetCursorPosX(); // "
|
IMGUI_API float GetCursorPosX(); // "
|
||||||
IMGUI_API float GetCursorPosY(); // "
|
IMGUI_API float GetCursorPosY(); // "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user