Skip to content

Commit

Permalink
Updated Dear Imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
dfeneyrou committed Sep 9, 2021
1 parent c50b614 commit 1af303f
Show file tree
Hide file tree
Showing 7 changed files with 953 additions and 745 deletions.
2 changes: 1 addition & 1 deletion server/external/imgui/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Extracted from Dear Imgui @docking at 073224f60034a228a8ebbf5452070d74f404fb53
Extracted from Dear Imgui @docking at 6451fed80bbf628a4368eb5aeaf949a4e1896a00
1,031 changes: 596 additions & 435 deletions server/external/imgui/imgui.cpp

Large diffs are not rendered by default.

141 changes: 88 additions & 53 deletions server/external/imgui/imgui.h

Large diffs are not rendered by default.

36 changes: 16 additions & 20 deletions server/external/imgui/imgui_draw.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84 WIP
// dear imgui, v1.85 WIP
// (drawing and font code)

/*
Expand Down Expand Up @@ -1485,24 +1485,22 @@ void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int nu
if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f)
return;

// Obtain segment count
if (num_segments <= 0)
{
// Automatic segment count
num_segments = _CalcCircleAutoSegmentCount(radius);
// Use arc with automatic segment count
_PathArcToFastEx(center, radius - 0.5f, 0, IM_DRAWLIST_ARCFAST_SAMPLE_MAX, 0);
_Path.Size--;
}
else
{
// Explicit segment count (still clamp to avoid drawing insanely tessellated shapes)
num_segments = ImClamp(num_segments, 3, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX);
}

// Because we are filling a closed shape we remove 1 from the count of segments/points
const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
if (num_segments == 12)
PathArcToFast(center, radius - 0.5f, 0, 12 - 1);
else
// Because we are filling a closed shape we remove 1 from the count of segments/points
const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1);
}

PathStroke(col, ImDrawFlags_Closed, thickness);
}

Expand All @@ -1511,24 +1509,22 @@ void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col,
if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f)
return;

// Obtain segment count
if (num_segments <= 0)
{
// Automatic segment count
num_segments = _CalcCircleAutoSegmentCount(radius);
// Use arc with automatic segment count
_PathArcToFastEx(center, radius, 0, IM_DRAWLIST_ARCFAST_SAMPLE_MAX, 0);
_Path.Size--;
}
else
{
// Explicit segment count (still clamp to avoid drawing insanely tessellated shapes)
num_segments = ImClamp(num_segments, 3, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX);
}

// Because we are filling a closed shape we remove 1 from the count of segments/points
const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
if (num_segments == 12)
PathArcToFast(center, radius, 0, 12 - 1);
else
// Because we are filling a closed shape we remove 1 from the count of segments/points
const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
PathArcTo(center, radius, 0.0f, a_max, num_segments - 1);
}

PathFillConvex(col);
}

Expand Down Expand Up @@ -2008,7 +2004,7 @@ void ImFontAtlas::ClearInputData()
ConfigData.clear();
CustomRects.clear();
PackIdMouseCursors = PackIdLines = -1;
TexReady = false;
// Important: we leave TexReady untouched
}

void ImFontAtlas::ClearTexData()
Expand Down
227 changes: 119 additions & 108 deletions server/external/imgui/imgui_internal.h

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion server/external/imgui/imgui_tables.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84 WIP
// dear imgui, v1.85 WIP
// (tables and columns code)

/*
Expand Down Expand Up @@ -1479,6 +1479,7 @@ void ImGui::TableSetupScrollFreeze(int columns, int rows)
table->IsUnfrozenRows = (table->FreezeRowsCount == 0); // Make sure this is set before TableUpdateLayout() so ImGuiListClipper can benefit from it.b

// Ensure frozen columns are ordered in their section. We still allow multiple frozen columns to be reordered.
// FIXME-TABLE: This work for preserving 2143 into 21|43. How about 4321 turning into 21|43? (preserve relative order in each section)
for (int column_n = 0; column_n < table->FreezeColumnsRequest; column_n++)
{
int order_n = table->DisplayOrderToIndex[column_n];
Expand Down
Loading

0 comments on commit 1af303f

Please sign in to comment.