mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-17 01:04:19 +00:00
Merge branch 'master' into docking
This commit is contained in:
commit
344d5ff4b7
9 changed files with 78 additions and 61 deletions
18
imgui.cpp
18
imgui.cpp
|
|
@ -4002,7 +4002,7 @@ void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCurso
|
|||
ImGuiContext& g = *GImGui;
|
||||
if (mouse_cursor <= ImGuiMouseCursor_None || mouse_cursor >= ImGuiMouseCursor_COUNT) // We intentionally accept out of bound values.
|
||||
mouse_cursor = ImGuiMouseCursor_Arrow;
|
||||
ImFontAtlas* font_atlas = g.DrawListSharedData.Font->ContainerAtlas;
|
||||
ImFontAtlas* font_atlas = g.DrawListSharedData.FontAtlas;
|
||||
for (ImGuiViewportP* viewport : g.Viewports)
|
||||
{
|
||||
// We scale cursor with current viewport/monitor, however Windows 10 for its own hardware cursor seems to be using a different scale factor.
|
||||
|
|
@ -6914,9 +6914,9 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
|
|||
// FIXME: CalcWindowAutoFitSize() doesn't take into account that only one axis may be auto-fit when calculating scrollbars,
|
||||
// we may need to compute/store three variants of size_auto_fit, for x/y/xy.
|
||||
// Here we implement a workaround for child windows only, but a full solution would apply to normal windows as well:
|
||||
if ((window->ChildFlags & ImGuiChildFlags_ResizeX) && !(window->ChildFlags & ImGuiChildFlags_ResizeY))
|
||||
if ((window->ChildFlags & ImGuiChildFlags_ResizeX) && !(window->ChildFlags & (ImGuiChildFlags_ResizeY | ImGuiChildFlags_AutoResizeY)))
|
||||
size_auto_fit.y = window->SizeFull.y;
|
||||
else if (!(window->ChildFlags & ImGuiChildFlags_ResizeX) && (window->ChildFlags & ImGuiChildFlags_ResizeY))
|
||||
else if ((window->ChildFlags & ImGuiChildFlags_ResizeY) && !(window->ChildFlags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_AutoResizeX)))
|
||||
size_auto_fit.x = window->SizeFull.x;
|
||||
|
||||
// When the window cannot fit all contents (either because of constraints, either because screen is too small),
|
||||
|
|
@ -7036,7 +7036,9 @@ static int ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& si
|
|||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindowFlags flags = window->Flags;
|
||||
|
||||
if ((flags & ImGuiWindowFlags_NoResize) || (flags & ImGuiWindowFlags_AlwaysAutoResize) || window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0)
|
||||
if ((flags & ImGuiWindowFlags_NoResize) || window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0)
|
||||
return false;
|
||||
if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && (window->ChildFlags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0)
|
||||
return false;
|
||||
if (window->WasActive == false) // Early out to avoid running this code for e.g. a hidden implicit/fallback Debug window.
|
||||
return false;
|
||||
|
|
@ -9424,10 +9426,12 @@ void ImGui::SetCurrentFont(ImFont* font, float font_size_before_scaling, float f
|
|||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
IM_ASSERT(font->Scale > 0.0f);
|
||||
#endif
|
||||
g.DrawListSharedData.Font = g.Font;
|
||||
ImFontAtlasUpdateDrawListsSharedData(g.Font->ContainerAtlas);
|
||||
ImFontAtlas* atlas = font->ContainerAtlas;
|
||||
g.DrawListSharedData.FontAtlas = atlas;
|
||||
g.DrawListSharedData.Font = font;
|
||||
ImFontAtlasUpdateDrawListsSharedData(atlas);
|
||||
if (g.CurrentWindow != NULL)
|
||||
g.CurrentWindow->DrawList->_SetTexture(font->ContainerAtlas->TexRef);
|
||||
g.CurrentWindow->DrawList->_SetTexture(atlas->TexRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue