mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Merge branch 'master' into docking
# Conflicts: # imgui_internal.h # imgui_widgets.cpp
This commit is contained in:
18
imgui.cpp
18
imgui.cpp
@ -1150,7 +1150,6 @@ void ImGuiStyle::ScaleAllSizes(float scale_factor)
|
||||
PopupRounding = ImFloor(PopupRounding * scale_factor);
|
||||
FramePadding = ImFloor(FramePadding * scale_factor);
|
||||
FrameRounding = ImFloor(FrameRounding * scale_factor);
|
||||
TabRounding = ImFloor(TabRounding * scale_factor);
|
||||
ItemSpacing = ImFloor(ItemSpacing * scale_factor);
|
||||
ItemInnerSpacing = ImFloor(ItemInnerSpacing * scale_factor);
|
||||
TouchExtraPadding = ImFloor(TouchExtraPadding * scale_factor);
|
||||
@ -1160,6 +1159,7 @@ void ImGuiStyle::ScaleAllSizes(float scale_factor)
|
||||
ScrollbarRounding = ImFloor(ScrollbarRounding * scale_factor);
|
||||
GrabMinSize = ImFloor(GrabMinSize * scale_factor);
|
||||
GrabRounding = ImFloor(GrabRounding * scale_factor);
|
||||
TabRounding = ImFloor(TabRounding * scale_factor);
|
||||
DisplayWindowPadding = ImFloor(DisplayWindowPadding * scale_factor);
|
||||
DisplaySafeAreaPadding = ImFloor(DisplaySafeAreaPadding * scale_factor);
|
||||
MouseCursorScale = ImFloor(MouseCursorScale * scale_factor);
|
||||
@ -6199,7 +6199,7 @@ void ImGui::SetCurrentFont(ImFont* font)
|
||||
IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
|
||||
IM_ASSERT(font->Scale > 0.0f);
|
||||
g.Font = font;
|
||||
g.FontBaseSize = g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale;
|
||||
g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale);
|
||||
g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f;
|
||||
|
||||
ImFontAtlas* atlas = g.Font->ContainerAtlas;
|
||||
@ -11516,7 +11516,7 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
|
||||
|
||||
// Begin tab bar
|
||||
const ImRect tab_bar_rect = DockNodeCalcTabBarRect(node);
|
||||
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_AutoSelectNewTabs | ImGuiTabBarFlags_NoTabListPopupButton;// | ImGuiTabBarFlags_NoTabListScrollingButtons);
|
||||
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_AutoSelectNewTabs; // | ImGuiTabBarFlags_NoTabListScrollingButtons);
|
||||
tab_bar_flags |= ImGuiTabBarFlags_SaveSettings | ImGuiTabBarFlags_DockNode;
|
||||
if (!host_window->Collapsed && is_focused)
|
||||
tab_bar_flags |= ImGuiTabBarFlags_IsFocused;
|
||||
@ -11904,7 +11904,7 @@ static void ImGui::DockNodePreviewDockRender(ImGuiWindow* host_window, ImGuiDock
|
||||
if (!tab_bar_rect.Contains(tab_bb))
|
||||
overlay_draw_lists[overlay_n]->PushClipRect(tab_bar_rect.Min, tab_bar_rect.Max);
|
||||
TabItemBackground(overlay_draw_lists[overlay_n], tab_bb, tab_flags, overlay_col_tabs);
|
||||
TabItemLabelAndCloseButton(overlay_draw_lists[overlay_n], tab_bb, tab_flags, payload->Name, 0, 0);
|
||||
TabItemLabelAndCloseButton(overlay_draw_lists[overlay_n], tab_bb, tab_flags, g.Style.FramePadding, payload->Name, 0, 0);
|
||||
if (!tab_bar_rect.Contains(tab_bb))
|
||||
overlay_draw_lists[overlay_n]->PopClipRect();
|
||||
}
|
||||
@ -13813,16 +13813,18 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
||||
// Display individual triangles/vertices. Hover on to get the corresponding triangle highlighted.
|
||||
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++)
|
||||
for (int prim = clipper.DisplayStart, idx_i = elem_offset + clipper.DisplayStart*3; prim < clipper.DisplayEnd; prim++)
|
||||
{
|
||||
char buf[300];
|
||||
char *buf_p = buf, *buf_end = buf + IM_ARRAYSIZE(buf);
|
||||
ImVec2 triangles_pos[3];
|
||||
for (int n = 0; n < 3; n++, vtx_i++)
|
||||
for (int n = 0; n < 3; n++, idx_i++)
|
||||
{
|
||||
ImDrawVert& v = draw_list->VtxBuffer[idx_buffer ? idx_buffer[vtx_i] : vtx_i];
|
||||
int vtx_i = idx_buffer ? idx_buffer[idx_i] : idx_i;
|
||||
ImDrawVert& v = draw_list->VtxBuffer[vtx_i];
|
||||
triangles_pos[n] = v.pos;
|
||||
buf_p += ImFormatString(buf_p, buf_end - 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);
|
||||
buf_p += ImFormatString(buf_p, buf_end - buf_p, "%s %04d: pos (%8.2f,%8.2f), uv (%.6f,%.6f), col %08X\n",
|
||||
(n == 0) ? "idx" : " ", idx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col);
|
||||
}
|
||||
ImGui::Selectable(buf, false);
|
||||
if (overlay_draw_list && ImGui::IsItemHovered())
|
||||
|
Reference in New Issue
Block a user