|
@@ -529,13 +529,13 @@
|
|
|
|
|
|
|
|
#include "imgui.h"
|
|
#include "imgui.h"
|
|
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
|
|
|
|
+#define IMGUI_DEFINE_PLACEMENT_NEW
|
|
|
#include "imgui_internal.h"
|
|
#include "imgui_internal.h"
|
|
|
|
|
|
|
|
#include <ctype.h> // toupper, isprint
|
|
#include <ctype.h> // toupper, isprint
|
|
|
#include <math.h> // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf
|
|
#include <math.h> // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf
|
|
|
#include <stdlib.h> // NULL, malloc, free, qsort, atoi
|
|
#include <stdlib.h> // NULL, malloc, free, qsort, atoi
|
|
|
#include <stdio.h> // vsnprintf, sscanf, printf
|
|
#include <stdio.h> // vsnprintf, sscanf, printf
|
|
|
-#include <new> // new (ptr)
|
|
|
|
|
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
|
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
|
|
#include <stddef.h> // intptr_t
|
|
#include <stddef.h> // intptr_t
|
|
|
#else
|
|
#else
|
|
@@ -1555,7 +1555,7 @@ ImGuiWindow::ImGuiWindow(const char* name)
|
|
|
FontWindowScale = 1.0f;
|
|
FontWindowScale = 1.0f;
|
|
|
|
|
|
|
|
DrawList = (ImDrawList*)ImGui::MemAlloc(sizeof(ImDrawList));
|
|
DrawList = (ImDrawList*)ImGui::MemAlloc(sizeof(ImDrawList));
|
|
|
- new(DrawList) ImDrawList();
|
|
|
|
|
|
|
+ IM_PLACEMENT_NEW(DrawList) ImDrawList();
|
|
|
DrawList->_OwnerName = Name;
|
|
DrawList->_OwnerName = Name;
|
|
|
RootWindow = NULL;
|
|
RootWindow = NULL;
|
|
|
RootNonPopupWindow = NULL;
|
|
RootNonPopupWindow = NULL;
|
|
@@ -1829,7 +1829,7 @@ size_t ImGui::GetInternalStateSize()
|
|
|
void ImGui::SetInternalState(void* state, bool construct)
|
|
void ImGui::SetInternalState(void* state, bool construct)
|
|
|
{
|
|
{
|
|
|
if (construct)
|
|
if (construct)
|
|
|
- new (state) ImGuiState();
|
|
|
|
|
|
|
+ IM_PLACEMENT_NEW(state) ImGuiState();
|
|
|
GImGui = (ImGuiState*)state;
|
|
GImGui = (ImGuiState*)state;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1874,7 +1874,7 @@ void ImGui::NewFrame()
|
|
|
{
|
|
{
|
|
|
// Initialize on first frame
|
|
// Initialize on first frame
|
|
|
g.LogClipboard = (ImGuiTextBuffer*)ImGui::MemAlloc(sizeof(ImGuiTextBuffer));
|
|
g.LogClipboard = (ImGuiTextBuffer*)ImGui::MemAlloc(sizeof(ImGuiTextBuffer));
|
|
|
- new(g.LogClipboard) ImGuiTextBuffer();
|
|
|
|
|
|
|
+ IM_PLACEMENT_NEW(g.LogClipboard) ImGuiTextBuffer();
|
|
|
|
|
|
|
|
IM_ASSERT(g.Settings.empty());
|
|
IM_ASSERT(g.Settings.empty());
|
|
|
LoadSettings();
|
|
LoadSettings();
|
|
@@ -3461,7 +3461,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
|
|
|
|
|
|
|
|
// Create window the first time
|
|
// Create window the first time
|
|
|
ImGuiWindow* window = (ImGuiWindow*)ImGui::MemAlloc(sizeof(ImGuiWindow));
|
|
ImGuiWindow* window = (ImGuiWindow*)ImGui::MemAlloc(sizeof(ImGuiWindow));
|
|
|
- new(window) ImGuiWindow(name);
|
|
|
|
|
|
|
+ IM_PLACEMENT_NEW(window) ImGuiWindow(name);
|
|
|
window->Flags = flags;
|
|
window->Flags = flags;
|
|
|
|
|
|
|
|
if (flags & ImGuiWindowFlags_NoSavedSettings)
|
|
if (flags & ImGuiWindowFlags_NoSavedSettings)
|
|
@@ -4071,7 +4071,6 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
|
|
clip_rect.Min.y = title_bar_rect.Max.y + window->MenuBarHeight() + 0.5f + border_size;
|
|
clip_rect.Min.y = title_bar_rect.Max.y + window->MenuBarHeight() + 0.5f + border_size;
|
|
|
clip_rect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x - ImMax(border_size, window->WindowPadding.x*0.5f);
|
|
clip_rect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x - ImMax(border_size, window->WindowPadding.x*0.5f);
|
|
|
clip_rect.Max.y = window->Pos.y + window->Size.y - border_size - window->ScrollbarSizes.y;
|
|
clip_rect.Max.y = window->Pos.y + window->Size.y - border_size - window->ScrollbarSizes.y;
|
|
|
-
|
|
|
|
|
PushClipRect(clip_rect.Min, clip_rect.Max, true);
|
|
PushClipRect(clip_rect.Min, clip_rect.Max, true);
|
|
|
|
|
|
|
|
// Clear 'accessed' flag last thing
|
|
// Clear 'accessed' flag last thing
|
|
@@ -4087,7 +4086,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
|
|
window->Collapsed = parent_window && parent_window->Collapsed;
|
|
window->Collapsed = parent_window && parent_window->Collapsed;
|
|
|
|
|
|
|
|
if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
|
|
if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
|
|
|
- window->Collapsed |= (window->ClipRect.Min.x >= window->ClipRect.Max.x || window->ClipRect.Min.y >= window->ClipRect.Max.y);
|
|
|
|
|
|
|
+ window->Collapsed |= (window->ClippedWindowRect.Min.x >= window->ClippedWindowRect.Max.x || window->ClippedWindowRect.Min.y >= window->ClippedWindowRect.Max.y);
|
|
|
|
|
|
|
|
// We also hide the window from rendering because we've already added its border to the command list.
|
|
// We also hide the window from rendering because we've already added its border to the command list.
|
|
|
// (we could perform the check earlier in the function but it is simpler at this point)
|
|
// (we could perform the check earlier in the function but it is simpler at this point)
|