mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-13 08:19:55 +02:00
Merge branch 'master' into docking + fix for RenderMouseCursor()
# Conflicts: # docs/CHANGELOG.txt # examples/imgui_impl_opengl3.cpp # imgui.cpp # imgui_draw.cpp # imgui_internal.h
This commit is contained in:
20
imgui.cpp
20
imgui.cpp
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.73 WIP
|
||||
// dear imgui, v1.73
|
||||
// (main code and documentation)
|
||||
|
||||
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
|
||||
@ -2754,8 +2754,8 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
|
||||
BeginOrderWithinContext = -1;
|
||||
PopupId = 0;
|
||||
AutoFitFramesX = AutoFitFramesY = -1;
|
||||
AutoFitOnlyGrows = false;
|
||||
AutoFitChildAxises = 0x00;
|
||||
AutoFitOnlyGrows = false;
|
||||
AutoPosLastDirection = ImGuiDir_None;
|
||||
HiddenFramesCanSkipItems = HiddenFramesCannotSkipItems = 0;
|
||||
SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = SetWindowDockAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
|
||||
@ -4597,8 +4597,13 @@ void ImGui::Render()
|
||||
AddRootWindowToDrawData(windows_to_render_top_most[n]);
|
||||
|
||||
// Draw software mouse cursor if requested
|
||||
if (g.IO.MouseDrawCursor)
|
||||
RenderMouseCursor(g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor);
|
||||
ImRect mouse_cursor_rect;
|
||||
if (g.IO.MouseDrawCursor && g.MouseCursor != ImGuiMouseCursor_None)
|
||||
{
|
||||
ImVec2 offset, size, uv[4];
|
||||
if (g.IO.Fonts->GetMouseCursorTexData(g.MouseCursor, &offset, &size, &uv[0], &uv[2]))
|
||||
mouse_cursor_rect = ImRect(g.IO.MousePos, g.IO.MousePos + ImVec2(size.x + 2, size.y + 2) * g.Style.MouseCursorScale);
|
||||
}
|
||||
|
||||
// Setup ImDrawData structures for end-user
|
||||
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = 0;
|
||||
@ -4607,6 +4612,9 @@ void ImGui::Render()
|
||||
ImGuiViewportP* viewport = g.Viewports[n];
|
||||
viewport->DrawDataBuilder.FlattenIntoSingleLayer();
|
||||
|
||||
if (viewport->GetRect().Overlaps(mouse_cursor_rect))
|
||||
RenderMouseCursor(GetForegroundDrawList(viewport), g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48));
|
||||
|
||||
// Add foreground ImDrawList (for each active viewport)
|
||||
if (viewport->DrawLists[1] != NULL)
|
||||
AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport));
|
||||
@ -5085,7 +5093,7 @@ static bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size
|
||||
|
||||
ImGuiWindow* child_window = g.CurrentWindow;
|
||||
child_window->ChildId = id;
|
||||
child_window->AutoFitChildAxises = auto_fit_axises;
|
||||
child_window->AutoFitChildAxises = (ImS8)auto_fit_axises;
|
||||
|
||||
// Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
|
||||
// While this is not really documented/defined, it seems that the expected thing to do.
|
||||
@ -6492,7 +6500,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->DC.TextWrapPosStack.resize(0);
|
||||
window->DC.CurrentColumns = NULL;
|
||||
window->DC.TreeDepth = 0;
|
||||
window->DC.TreeStoreMayJumpToParentOnPop = 0x00;
|
||||
window->DC.TreeMayJumpToParentOnPopMask = 0x00;
|
||||
window->DC.StateStorage = &window->StateStorage;
|
||||
window->DC.GroupStack.resize(0);
|
||||
window->MenuColumns.Update(3, style.ItemSpacing.x, window_just_activated_by_user);
|
||||
|
Reference in New Issue
Block a user