From e912bcb36d347bfb36b1a33f6387deeda37e6d23 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 17 May 2015 12:10:57 +0100 Subject: [PATCH] Comments --- imgui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 6f99f3702..0877f1fd1 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7682,7 +7682,7 @@ void ImGui::Spacing() ItemSize(ImVec2(0,0)); } -// Advance cursor given item size. +// Advance cursor given item size for layout. static void ItemSize(ImVec2 size, float text_offset_y) { ImGuiState& g = *GImGui; @@ -7730,6 +7730,9 @@ bool ImGui::IsRectClipped(const ImVec2& size) return IsClippedEx(ImRect(window->DC.CursorPos, window->DC.CursorPos + size), NULL, true); } +// Declare item bounding box for clipping and interaction. +// Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface +// declares their minimum size requirement to ItemSize() and then use a larger region for drawing/interaction, which is passed to ItemAdd(). static bool ItemAdd(const ImRect& bb, const ImGuiID* id) { ImGuiWindow* window = GetCurrentWindow();