|
|
@@ -611,6 +611,7 @@
|
|
|
#include <math.h> // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf
|
|
|
#include <stdlib.h> // NULL, malloc, free, qsort, atoi
|
|
|
#include <stdio.h> // vsnprintf, sscanf, printf
|
|
|
+#include <limits.h> // INT_MIN, INT_MAX
|
|
|
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
|
|
#include <stddef.h> // intptr_t
|
|
|
#else
|
|
|
@@ -867,9 +868,6 @@ void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars)
|
|
|
|
|
|
#define IM_F32_TO_INT8(_VAL) ((int)((_VAL) * 255.0f + 0.5f))
|
|
|
|
|
|
-#define IM_INT_MIN (-2147483647-1)
|
|
|
-#define IM_INT_MAX (2147483647)
|
|
|
-
|
|
|
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
|
|
|
#ifdef _WIN32
|
|
|
#define IM_NEWLINE "\r\n"
|
|
|
@@ -1611,6 +1609,86 @@ float ImGuiSimpleColumns::CalcExtraSpace(float avail_w)
|
|
|
return ImMax(0.0f, avail_w - Width);
|
|
|
}
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+// ImGuiListClipper
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+
|
|
|
+static void SetCursorPosYAndSetupDummyPrevLine(float pos_y, float line_height)
|
|
|
+{
|
|
|
+ // Setting those fields so that SetScrollHere() can properly function after the end of our clipper usage.
|
|
|
+ // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list.
|
|
|
+ ImGui::SetCursorPosY(pos_y);
|
|
|
+ ImGuiWindow* window = ImGui::GetCurrentWindow();
|
|
|
+ window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height;
|
|
|
+ window->DC.PrevLineHeight = (line_height - GImGui->Style.ItemSpacing.y);
|
|
|
+}
|
|
|
+
|
|
|
+// Use case A: Begin() called from constructor with items_height<0, then called again from Sync() in StepNo 1
|
|
|
+// Use case B: Begin() called from constructor with items_height>0
|
|
|
+// FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style.
|
|
|
+void ImGuiListClipper::Begin(int count, float items_height)
|
|
|
+{
|
|
|
+ StartPosY = ImGui::GetCursorPosY();
|
|
|
+ ItemsHeight = items_height;
|
|
|
+ ItemsCount = count;
|
|
|
+ StepNo = 0;
|
|
|
+ DisplayEnd = DisplayStart = -1;
|
|
|
+ if (ItemsHeight > 0.0f)
|
|
|
+ {
|
|
|
+ ImGui::CalcListClipping(ItemsCount, ItemsHeight, &DisplayStart, &DisplayEnd); // calculate how many to clip/display
|
|
|
+ if (DisplayStart > 0)
|
|
|
+ SetCursorPosYAndSetupDummyPrevLine(StartPosY + DisplayStart * ItemsHeight, ItemsHeight); // advance cursor
|
|
|
+ StepNo = 2;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void ImGuiListClipper::End()
|
|
|
+{
|
|
|
+ if (ItemsCount < 0)
|
|
|
+ return;
|
|
|
+ // In theory here we should assert that ImGui::GetCursorPosY() == StartPosY + DisplayEnd * ItemsHeight, but it feels saner to just seek at the end and not assert/crash the user.
|
|
|
+ if (ItemsCount < INT_MAX)
|
|
|
+ SetCursorPosYAndSetupDummyPrevLine(StartPosY + ItemsCount * ItemsHeight, ItemsHeight); // advance cursor
|
|
|
+ ItemsCount = -1;
|
|
|
+ StepNo = 3;
|
|
|
+}
|
|
|
+
|
|
|
+bool ImGuiListClipper::Step()
|
|
|
+{
|
|
|
+ if (ItemsCount == 0 || ImGui::GetCurrentWindowRead()->SkipItems)
|
|
|
+ {
|
|
|
+ ItemsCount = -1;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (StepNo == 0) // Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height.
|
|
|
+ {
|
|
|
+ DisplayStart = 0;
|
|
|
+ DisplayEnd = 1;
|
|
|
+ StartPosY = ImGui::GetCursorPosY();
|
|
|
+ StepNo = 1;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (StepNo == 1) // Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element.
|
|
|
+ {
|
|
|
+ if (ItemsCount == 1) { ItemsCount = -1; return false; }
|
|
|
+ float items_height = ImGui::GetCursorPosY() - StartPosY;
|
|
|
+ IM_ASSERT(items_height > 0.0f); // If this triggers, it means Item 0 hasn't moved the cursor vertically
|
|
|
+ ImGui::SetCursorPosY(StartPosY); // Rewind cursor so we can Begin() again, this time with a known height.
|
|
|
+ Begin(ItemsCount, items_height);
|
|
|
+ StepNo = 3;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (StepNo == 2) // Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user still call Step(). Does nothing and switch to Step 3.
|
|
|
+ {
|
|
|
+ IM_ASSERT(DisplayStart >= 0 && DisplayEnd >= 0);
|
|
|
+ StepNo = 3;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (StepNo == 3) // Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop.
|
|
|
+ End();
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
//-----------------------------------------------------------------------------
|
|
|
// ImGuiWindow
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@@ -1659,8 +1737,8 @@ ImGuiWindow::ImGuiWindow(const char* name)
|
|
|
ParentWindow = NULL;
|
|
|
|
|
|
FocusIdxAllCounter = FocusIdxTabCounter = -1;
|
|
|
- FocusIdxAllRequestCurrent = FocusIdxTabRequestCurrent = IM_INT_MAX;
|
|
|
- FocusIdxAllRequestNext = FocusIdxTabRequestNext = IM_INT_MAX;
|
|
|
+ FocusIdxAllRequestCurrent = FocusIdxTabRequestCurrent = INT_MAX;
|
|
|
+ FocusIdxAllRequestNext = FocusIdxTabRequestNext = INT_MAX;
|
|
|
}
|
|
|
|
|
|
ImGuiWindow::~ImGuiWindow()
|
|
|
@@ -1824,7 +1902,7 @@ bool ImGui::FocusableItemRegister(ImGuiWindow* window, bool is_active, bool tab_
|
|
|
|
|
|
// Process keyboard input at this point: TAB, Shift-TAB switch focus
|
|
|
// We can always TAB out of a widget that doesn't allow tabbing in.
|
|
|
- if (tab_stop && window->FocusIdxAllRequestNext == IM_INT_MAX && window->FocusIdxTabRequestNext == IM_INT_MAX && is_active && IsKeyPressedMap(ImGuiKey_Tab))
|
|
|
+ if (tab_stop && window->FocusIdxAllRequestNext == INT_MAX && window->FocusIdxTabRequestNext == INT_MAX && is_active && IsKeyPressedMap(ImGuiKey_Tab))
|
|
|
{
|
|
|
// Modulo on index will be applied at the end of frame once we've got the total counter of items.
|
|
|
window->FocusIdxTabRequestNext = window->FocusIdxTabCounter + (g.IO.KeyShift ? (allow_keyboard_focus ? -1 : 0) : +1);
|
|
|
@@ -2882,18 +2960,8 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
|
|
|
}
|
|
|
|
|
|
// Helper to calculate coarse clipping of large list of evenly sized items.
|
|
|
-// NB: Prefer using the ImGuiListClipper higher-level helper if you can!
|
|
|
+// NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instructions there on how those use this sort of pattern.
|
|
|
// NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX
|
|
|
-// If you are displaying thousands of items and you have a random access to the list, you can perform clipping yourself to save on CPU.
|
|
|
-// {
|
|
|
-// float item_height = ImGui::GetTextLineHeightWithSpacing();
|
|
|
-// int display_start, display_end;
|
|
|
-// ImGui::CalcListClipping(count, item_height, &display_start, &display_end); // calculate how many to clip/display
|
|
|
-// ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (display_start) * item_height); // advance cursor
|
|
|
-// for (int i = display_start; i < display_end; i++) // display only visible items
|
|
|
-// // TODO: display visible item
|
|
|
-// ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (count - display_end) * item_height); // advance cursor
|
|
|
-// }
|
|
|
void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
@@ -2905,6 +2973,11 @@ void ImGui::CalcListClipping(int items_count, float items_height, int* out_items
|
|
|
*out_items_display_end = items_count;
|
|
|
return;
|
|
|
}
|
|
|
+ if (window->SkipItems)
|
|
|
+ {
|
|
|
+ *out_items_display_start = *out_items_display_end = 0;
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
const ImVec2 pos = window->DC.CursorPos;
|
|
|
int start = (int)((window->ClipRect.Min.y - pos.y) / items_height);
|
|
|
@@ -3548,12 +3621,12 @@ static void CheckStacksSize(ImGuiWindow* window, bool write)
|
|
|
// NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.ButtonRepeat, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
int* p_backup = &window->DC.StackSizesBackup[0];
|
|
|
- { int current = window->IDStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopID()
|
|
|
- { int current = window->DC.GroupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot EndGroup()
|
|
|
- { int current = g.CurrentPopupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot EndPopup()/EndMenu()
|
|
|
- { int current = g.ColorModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopStyleColor()
|
|
|
- { int current = g.StyleModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopStyleVar()
|
|
|
- { int current = g.FontStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopFont()
|
|
|
+ { int current = window->IDStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushID/PopID Mismatch!"); p_backup++; } // User forgot PopID()
|
|
|
+ { int current = window->DC.GroupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "BeginGroup/EndGroup Mismatch!"); p_backup++; } // User forgot EndGroup()
|
|
|
+ { int current = g.CurrentPopupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch"); p_backup++; }// User forgot EndPopup()/EndMenu()
|
|
|
+ { int current = g.ColorModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushStyleColor/PopStyleColor Mismatch!"); p_backup++; } // User forgot PopStyleColor()
|
|
|
+ { int current = g.StyleModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushStyleVar/PopStyleVar Mismatch!"); p_backup++; } // User forgot PopStyleVar()
|
|
|
+ { int current = g.FontStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushFont/PopFont Mismatch!"); p_backup++; } // User forgot PopFont()
|
|
|
IM_ASSERT(p_backup == window->DC.StackSizesBackup + IM_ARRAYSIZE(window->DC.StackSizesBackup));
|
|
|
}
|
|
|
|
|
|
@@ -3979,10 +4052,10 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
|
|
|
window->ItemWidthDefault = (float)(int)(g.FontSize * 16.0f);
|
|
|
|
|
|
// Prepare for focus requests
|
|
|
- window->FocusIdxAllRequestCurrent = (window->FocusIdxAllRequestNext == IM_INT_MAX || window->FocusIdxAllCounter == -1) ? IM_INT_MAX : (window->FocusIdxAllRequestNext + (window->FocusIdxAllCounter+1)) % (window->FocusIdxAllCounter+1);
|
|
|
- window->FocusIdxTabRequestCurrent = (window->FocusIdxTabRequestNext == IM_INT_MAX || window->FocusIdxTabCounter == -1) ? IM_INT_MAX : (window->FocusIdxTabRequestNext + (window->FocusIdxTabCounter+1)) % (window->FocusIdxTabCounter+1);
|
|
|
+ window->FocusIdxAllRequestCurrent = (window->FocusIdxAllRequestNext == INT_MAX || window->FocusIdxAllCounter == -1) ? INT_MAX : (window->FocusIdxAllRequestNext + (window->FocusIdxAllCounter+1)) % (window->FocusIdxAllCounter+1);
|
|
|
+ window->FocusIdxTabRequestCurrent = (window->FocusIdxTabRequestNext == INT_MAX || window->FocusIdxTabCounter == -1) ? INT_MAX : (window->FocusIdxTabRequestNext + (window->FocusIdxTabCounter+1)) % (window->FocusIdxTabCounter+1);
|
|
|
window->FocusIdxAllCounter = window->FocusIdxTabCounter = -1;
|
|
|
- window->FocusIdxAllRequestNext = window->FocusIdxTabRequestNext = IM_INT_MAX;
|
|
|
+ window->FocusIdxAllRequestNext = window->FocusIdxTabRequestNext = INT_MAX;
|
|
|
|
|
|
// Apply scrolling
|
|
|
if (window->ScrollTarget.x < FLT_MAX)
|
|
|
@@ -5077,7 +5150,7 @@ void ImGui::SetKeyboardFocusHere(int offset)
|
|
|
{
|
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
window->FocusIdxAllRequestNext = window->FocusIdxAllCounter + 1 + offset;
|
|
|
- window->FocusIdxTabRequestNext = IM_INT_MAX;
|
|
|
+ window->FocusIdxTabRequestNext = INT_MAX;
|
|
|
}
|
|
|
|
|
|
void ImGui::SetStateStorage(ImGuiStorage* tree)
|
|
|
@@ -6866,10 +6939,10 @@ bool ImGui::DragIntRange2(const char* label, int* v_current_min, int* v_current_
|
|
|
ImGui::BeginGroup();
|
|
|
PushMultiItemsWidths(2);
|
|
|
|
|
|
- bool value_changed = ImGui::DragInt("##min", v_current_min, v_speed, (v_min >= v_max) ? IM_INT_MIN : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), display_format);
|
|
|
+ bool value_changed = ImGui::DragInt("##min", v_current_min, v_speed, (v_min >= v_max) ? INT_MIN : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), display_format);
|
|
|
ImGui::PopItemWidth();
|
|
|
ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
|
|
|
- value_changed |= ImGui::DragInt("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? IM_INT_MAX : v_max, display_format_max ? display_format_max : display_format);
|
|
|
+ value_changed |= ImGui::DragInt("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? INT_MAX : v_max, display_format_max ? display_format_max : display_format);
|
|
|
ImGui::PopItemWidth();
|
|
|
ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
|
|
|
|
|
|
@@ -7964,9 +8037,9 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
|
|
|
// Draw blinking cursor
|
|
|
bool cursor_is_visible = (g.InputTextState.CursorAnim <= 0.0f) || fmodf(g.InputTextState.CursorAnim, 1.20f) <= 0.80f;
|
|
|
ImVec2 cursor_screen_pos = render_pos + cursor_offset - render_scroll;
|
|
|
- ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y-g.FontSize+0.5f, cursor_screen_pos.x, cursor_screen_pos.y-1.5f);
|
|
|
+ ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y-g.FontSize+0.5f, cursor_screen_pos.x+1.0f, cursor_screen_pos.y-1.5f);
|
|
|
if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect))
|
|
|
- draw_window->DrawList->AddLine(cursor_screen_rect.Min, cursor_screen_rect.Max, GetColorU32(ImGuiCol_Text));
|
|
|
+ draw_window->DrawList->AddLine(cursor_screen_rect.Min, cursor_screen_rect.GetBL(), GetColorU32(ImGuiCol_Text));
|
|
|
|
|
|
// Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.)
|
|
|
if (is_editable)
|
|
|
@@ -8497,22 +8570,22 @@ bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(v
|
|
|
// Assume all items have even height (= 1 line of text). If you need items of different or variable sizes you can create a custom version of ListBox() in your code without using the clipper.
|
|
|
bool value_changed = false;
|
|
|
ImGuiListClipper clipper(items_count, ImGui::GetTextLineHeightWithSpacing());
|
|
|
- for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
|
|
|
- {
|
|
|
- const bool item_selected = (i == *current_item);
|
|
|
- const char* item_text;
|
|
|
- if (!items_getter(data, i, &item_text))
|
|
|
- item_text = "*Unknown item*";
|
|
|
-
|
|
|
- ImGui::PushID(i);
|
|
|
- if (ImGui::Selectable(item_text, item_selected))
|
|
|
+ while (clipper.Step())
|
|
|
+ for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
|
|
|
{
|
|
|
- *current_item = i;
|
|
|
- value_changed = true;
|
|
|
+ const bool item_selected = (i == *current_item);
|
|
|
+ const char* item_text;
|
|
|
+ if (!items_getter(data, i, &item_text))
|
|
|
+ item_text = "*Unknown item*";
|
|
|
+
|
|
|
+ ImGui::PushID(i);
|
|
|
+ if (ImGui::Selectable(item_text, item_selected))
|
|
|
+ {
|
|
|
+ *current_item = i;
|
|
|
+ value_changed = true;
|
|
|
+ }
|
|
|
+ ImGui::PopID();
|
|
|
}
|
|
|
- ImGui::PopID();
|
|
|
- }
|
|
|
- clipper.End();
|
|
|
ImGui::ListBoxFooter();
|
|
|
return value_changed;
|
|
|
}
|
|
|
@@ -9052,6 +9125,17 @@ void ImGui::SameLine(float pos_x, float spacing_w)
|
|
|
window->DC.CurrentLineTextBaseOffset = window->DC.PrevLineTextBaseOffset;
|
|
|
}
|
|
|
|
|
|
+void ImGui::NewLine()
|
|
|
+{
|
|
|
+ ImGuiWindow* window = GetCurrentWindow();
|
|
|
+ if (window->SkipItems)
|
|
|
+ return;
|
|
|
+ if (window->DC.CurrentLineHeight > 0.0f) // In the event that we are on a line with items that is smaller that FontSize high, we will preserve its height.
|
|
|
+ ItemSize(ImVec2(0,0));
|
|
|
+ else
|
|
|
+ ItemSize(ImVec2(0.0f, GImGui->FontSize));
|
|
|
+}
|
|
|
+
|
|
|
void ImGui::NextColumn()
|
|
|
{
|
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
@@ -9525,22 +9609,22 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
}
|
|
|
if (!pcmd_node_open)
|
|
|
continue;
|
|
|
- ImGuiListClipper clipper(pcmd->ElemCount/3, ImGui::GetTextLineHeight()*3 + ImGui::GetStyle().ItemSpacing.y); // Manually coarse clip our print out of individual vertices to save CPU, only items that may be visible.
|
|
|
- for (int prim = clipper.DisplayStart, vtx_i = elem_offset + clipper.DisplayStart*3; prim < clipper.DisplayEnd; prim++)
|
|
|
- {
|
|
|
- char buf[300], *buf_p = buf;
|
|
|
- ImVec2 triangles_pos[3];
|
|
|
- for (int n = 0; n < 3; n++, vtx_i++)
|
|
|
+ ImGuiListClipper clipper(pcmd->ElemCount/3); // Manually coarse clip our print out of individual vertices to save CPU, only items that may be visible.
|
|
|
+ while (clipper.Step())
|
|
|
+ for (int prim = clipper.DisplayStart, vtx_i = elem_offset + clipper.DisplayStart*3; prim < clipper.DisplayEnd; prim++)
|
|
|
{
|
|
|
- ImDrawVert& v = draw_list->VtxBuffer[idx_buffer ? idx_buffer[vtx_i] : vtx_i];
|
|
|
- triangles_pos[n] = v.pos;
|
|
|
- buf_p += sprintf(buf_p, "%s %04d { pos = (%8.2f,%8.2f), uv = (%.6f,%.6f), col = %08X }\n", (n == 0) ? "vtx" : " ", vtx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col);
|
|
|
+ char buf[300], *buf_p = buf;
|
|
|
+ ImVec2 triangles_pos[3];
|
|
|
+ for (int n = 0; n < 3; n++, vtx_i++)
|
|
|
+ {
|
|
|
+ ImDrawVert& v = draw_list->VtxBuffer[idx_buffer ? idx_buffer[vtx_i] : vtx_i];
|
|
|
+ triangles_pos[n] = v.pos;
|
|
|
+ buf_p += sprintf(buf_p, "%s %04d { pos = (%8.2f,%8.2f), uv = (%.6f,%.6f), col = %08X }\n", (n == 0) ? "vtx" : " ", vtx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col);
|
|
|
+ }
|
|
|
+ ImGui::Selectable(buf, false);
|
|
|
+ if (ImGui::IsItemHovered())
|
|
|
+ overlay_draw_list->AddPolyline(triangles_pos, 3, IM_COL32(255,255,0,255), true, 1.0f, false); // Add triangle without AA, more readable for large-thin triangle
|
|
|
}
|
|
|
- ImGui::Selectable(buf, false);
|
|
|
- if (ImGui::IsItemHovered())
|
|
|
- overlay_draw_list->AddPolyline(triangles_pos, 3, IM_COL32(255,255,0,255), true, 1.0f, false); // Add triangle without AA, more readable for large-thin triangle
|
|
|
- }
|
|
|
- clipper.End();
|
|
|
ImGui::TreePop();
|
|
|
}
|
|
|
overlay_draw_list->PopClipRect();
|