From 4eda0efbacdc8ffa2732dbbcfbff8ecee4f8dd53 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Sat, 22 Oct 2022 10:58:28 -0700 Subject: [PATCH 01/13] Fixes to build on latest imgui, disabled a bunch of warnings --- crude_json.cpp | 16 ++++++++++++- crude_json.h | 15 ++++++++++-- imgui_bezier_math.inl | 13 +++++++++++ imgui_node_editor.cpp | 54 ++++++++++--------------------------------- 4 files changed, 53 insertions(+), 45 deletions(-) diff --git a/crude_json.cpp b/crude_json.cpp index a9f7c7079..0c3448c15 100644 --- a/crude_json.cpp +++ b/crude_json.cpp @@ -1,4 +1,13 @@ -// Crude implementation of JSON value object and parser. +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcomment" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +// Crude implementation of JSON value object and parser. // // VERSION 0.1 // @@ -888,3 +897,8 @@ bool value::save(const string& path, const int indent, const char indent_char) c # endif } // namespace crude_json + +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic pop +#endif diff --git a/crude_json.h b/crude_json.h index f1eff29e2..48e7dffda 100644 --- a/crude_json.h +++ b/crude_json.h @@ -1,4 +1,10 @@ -// Crude implementation of JSON value object and parser. +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#endif + +// Crude implementation of JSON value object and parser. // // VERSION 0.1 // @@ -247,4 +253,9 @@ template <> inline number* value::get_ptr() { if (m_Type = } // namespace crude_json -# endif // __CRUDE_JSON_H__ \ No newline at end of file +# endif // __CRUDE_JSON_H__ + +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic pop +#endif diff --git a/imgui_bezier_math.inl b/imgui_bezier_math.inl index 3020bdb49..a14de58b5 100644 --- a/imgui_bezier_math.inl +++ b/imgui_bezier_math.inl @@ -1,3 +1,12 @@ +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcomment" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + //------------------------------------------------------------------------------ // VERSION 0.1 // @@ -673,3 +682,7 @@ inline void ImCubicBezierFixedStep(F& callback, const ImCubicBezierPoints& curve //------------------------------------------------------------------------------ # endif // __IMGUI_BEZIER_MATH_INL__ + +#ifndef _MSC_VER +#pragma GCC diagnostic pop +#endif diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index 3e1539286..0f243caf6 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -1,3 +1,9 @@ +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#endif + //------------------------------------------------------------------------------ // VERSION 0.9.1 // @@ -35,46 +41,6 @@ static bool const value = sizeof(test(0)) == sizeof(yes); \ }; - -namespace ax { -namespace NodeEditor { -namespace Detail { - -# define DECLARE_KEY_TESTER(Key) \ - DECLARE_HAS_NESTED(Key, Key) \ - struct KeyTester_ ## Key \ - { \ - template \ - static int Get(typename std::enable_if::value, T>::type*) \ - { \ - return ImGui::GetKeyIndex(T::Key); \ - } \ - \ - template \ - static int Get(typename std::enable_if::value, T>::type*) \ - { \ - return -1; \ - } \ - } - -DECLARE_KEY_TESTER(ImGuiKey_F); -DECLARE_KEY_TESTER(ImGuiKey_D); - -static inline int GetKeyIndexForF() -{ - return KeyTester_ImGuiKey_F::Get(nullptr); -} - -static inline int GetKeyIndexForD() -{ - return KeyTester_ImGuiKey_D::Get(nullptr); -} - -} // namespace Detail -} // namespace NodeEditor -} // namespace ax - - //------------------------------------------------------------------------------ namespace ed = ax::NodeEditor::Detail; @@ -3314,7 +3280,7 @@ ed::EditorAction::AcceptResult ed::NavigateAction::Accept(const Control& control auto& io = ImGui::GetIO(); - if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(GetKeyIndexForF()) && Editor->AreShortcutsEnabled()) + if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(ImGuiKey_F) && Editor->AreShortcutsEnabled()) { const auto zoomMode = io.KeyShift ? NavigateAction::ZoomMode::WithMargin : NavigateAction::ZoomMode::None; @@ -4353,7 +4319,7 @@ ed::EditorAction::AcceptResult ed::ShortcutAction::Accept(const Control& control candidateAction = Copy; if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_V))) candidateAction = Paste; - if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(GetKeyIndexForD())) + if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_D))) candidateAction = Duplicate; if (!io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) candidateAction = CreateNode; @@ -5807,3 +5773,7 @@ void ed::Config::EndSave() if (EndSaveSession) EndSaveSession(UserPointer); } + +#ifndef _MSC_VER +#pragma GCC diagnostic pop +#endif From 15c98f883a74188a7eb64809ea0e44511b849573 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Sat, 22 Oct 2022 20:34:46 -0700 Subject: [PATCH 02/13] Added more warning disable flags --- imgui_node_editor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index 0f243caf6..71116136d 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -2,6 +2,8 @@ #ifndef _MSC_VER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wcomment" +#pragma GCC diagnostic ignored "-Wunused-parameter" #endif //------------------------------------------------------------------------------ From ba30917621c81b02ffb412091f11c790213ac56f Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Wed, 26 Oct 2022 10:19:55 -0700 Subject: [PATCH 03/13] Added more warning disable flags --- imgui_node_editor_api.cpp | 13 +++++++++++++ imgui_node_editor_internal.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/imgui_node_editor_api.cpp b/imgui_node_editor_api.cpp index c8c7c3ff7..b60dd3a13 100644 --- a/imgui_node_editor_api.cpp +++ b/imgui_node_editor_api.cpp @@ -1,3 +1,11 @@ +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wcomment" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + //------------------------------------------------------------------------------ // VERSION 0.9.1 // @@ -760,3 +768,8 @@ int ax::NodeEditor::GetOrderedNodeIds(NodeId* nodes, int size) { return s_Editor->GetNodeIds(nodes, size); } + +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic pop +#endif diff --git a/imgui_node_editor_internal.h b/imgui_node_editor_internal.h index 4c57725f0..684175723 100644 --- a/imgui_node_editor_internal.h +++ b/imgui_node_editor_internal.h @@ -1,3 +1,11 @@ +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wcomment" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + //------------------------------------------------------------------------------ // VERSION 0.9.1 // @@ -1554,3 +1562,8 @@ struct EditorContext //------------------------------------------------------------------------------ # endif // __IMGUI_NODE_EDITOR_INTERNAL_H__ + +//Disable a bunch of warnings for now +#ifndef _MSC_VER +#pragma GCC diagnostic pop +#endif From a13700e3444447dd21ce6c51c473ac5d6b71efdf Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Wed, 26 Oct 2022 11:01:58 -0700 Subject: [PATCH 04/13] Comment cleanup --- crude_json.cpp | 1 - imgui_bezier_math.inl | 25 +++++++++++++------------ imgui_node_editor.cpp | 1 - imgui_node_editor_api.cpp | 1 - imgui_node_editor_internal.h | 1 - 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/crude_json.cpp b/crude_json.cpp index 0c3448c15..38617e581 100644 --- a/crude_json.cpp +++ b/crude_json.cpp @@ -1,7 +1,6 @@ //Disable a bunch of warnings for now #ifndef _MSC_VER #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcomment" #pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #pragma GCC diagnostic ignored "-Wunused-parameter" diff --git a/imgui_bezier_math.inl b/imgui_bezier_math.inl index a14de58b5..9f497f640 100644 --- a/imgui_bezier_math.inl +++ b/imgui_bezier_math.inl @@ -1,7 +1,6 @@ //Disable a bunch of warnings for now #ifndef _MSC_VER #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcomment" #pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #pragma GCC diagnostic ignored "-Wunused-parameter" @@ -404,17 +403,19 @@ inline ImCubicBezierIntersectResult ImCubicBezierLineIntersect(const ImVec2& p0, return count; }; - // https://github.com/kaishiqi/Geometric-Bezier/blob/master/GeometricBezier/src/kaishiqi/geometric/intersection/Intersection.as - // - // Start with Bezier using Bernstein polynomials for weighting functions: - // (1-t^3)P0 + 3t(1-t)^2P1 + 3t^2(1-t)P2 + t^3P3 - // - // Expand and collect terms to form linear combinations of original Bezier - // controls. This ends up with a vector cubic in t: - // (-P0+3P1-3P2+P3)t^3 + (3P0-6P1+3P2)t^2 + (-3P0+3P1)t + P0 - // /\ /\ /\ /\ - // || || || || - // c3 c2 c1 c0 + /* + https://github.com/kaishiqi/Geometric-Bezier/blob/master/GeometricBezier/src/kaishiqi/geometric/intersection/Intersection.as + + Start with Bezier using Bernstein polynomials for weighting functions: + (1-t^3)P0 + 3t(1-t)^2P1 + 3t^2(1-t)P2 + t^3P3 + + Expand and collect terms to form linear combinations of original Bezier + controls. This ends up with a vector cubic in t: + (-P0+3P1-3P2+P3)t^3 + (3P0-6P1+3P2)t^2 + (-3P0+3P1)t + P0 + /\ /\ /\ /\ + || || || || + c3 c2 c1 c0 + */ // Calculate the coefficients auto c3 = -p0 + 3 * p1 - 3 * p2 + p3; diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index 71116136d..fae89fd0c 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -2,7 +2,6 @@ #ifndef _MSC_VER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" -#pragma GCC diagnostic ignored "-Wcomment" #pragma GCC diagnostic ignored "-Wunused-parameter" #endif diff --git a/imgui_node_editor_api.cpp b/imgui_node_editor_api.cpp index b60dd3a13..74330855f 100644 --- a/imgui_node_editor_api.cpp +++ b/imgui_node_editor_api.cpp @@ -2,7 +2,6 @@ #ifndef _MSC_VER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" -#pragma GCC diagnostic ignored "-Wcomment" #pragma GCC diagnostic ignored "-Wunused-parameter" #endif diff --git a/imgui_node_editor_internal.h b/imgui_node_editor_internal.h index 684175723..fd2bfac0d 100644 --- a/imgui_node_editor_internal.h +++ b/imgui_node_editor_internal.h @@ -2,7 +2,6 @@ #ifndef _MSC_VER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" -#pragma GCC diagnostic ignored "-Wcomment" #pragma GCC diagnostic ignored "-Wunused-parameter" #endif From e4602d53d4f8d2c39a87e380ebe09501093c529c Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Tue, 22 Nov 2022 20:26:54 -0800 Subject: [PATCH 05/13] Fixes to build on latest imgui 1.89.1 --- imgui_node_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index fae89fd0c..cd1832432 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -2515,7 +2515,7 @@ ed::Control ed::EditorContext::BuildControl(bool allowOffscreen) # if IMGUI_VERSION_NUM >= 17909 if (m_IsHoveredWithoutOverlapp) - ImGui::SetItemUsingMouseWheel(); + ImGui::SetItemKeyOwner(ImGuiKey_MouseWheelY); # endif return Control(hotObject, activeObject, clickedObject, doubleClickedObject, From bcee4436594d0e5370a11984dd0c842afa6b38dd Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Tue, 7 Mar 2023 22:54:23 -0800 Subject: [PATCH 06/13] Added IMGUI_DEFINE_MATH_OPERATORS so we can build with ImGui v1.89.3 and later --- imgui_node_editor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui_node_editor.h b/imgui_node_editor.h index a173cde30..400c0d7ce 100644 --- a/imgui_node_editor.h +++ b/imgui_node_editor.h @@ -15,6 +15,7 @@ //------------------------------------------------------------------------------ +#define IMGUI_DEFINE_MATH_OPERATORS # include # include // std::uintXX_t # include // std::move @@ -507,4 +508,4 @@ struct PinId final: Details::SafePointerType //------------------------------------------------------------------------------ -# endif // __IMGUI_NODE_EDITOR_H__ \ No newline at end of file +# endif // __IMGUI_NODE_EDITOR_H__ From 67e85c2e128ae0a2ef9995948739bb42c640e4e6 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Tue, 7 Mar 2023 23:11:00 -0800 Subject: [PATCH 07/13] Added temporary workaround for https://github.com/thedmd/imgui-node-editor/issues/205 --- imgui_canvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_canvas.cpp b/imgui_canvas.cpp index c71a41312..c58c8edd7 100644 --- a/imgui_canvas.cpp +++ b/imgui_canvas.cpp @@ -115,7 +115,7 @@ bool ImGuiEx::Canvas::Begin(ImGuiID id, const ImVec2& size) // #debug: Canvas content. //m_DrawList->AddRectFilled(m_StartPos, m_StartPos + m_CurrentSize, IM_COL32(0, 0, 0, 64)); - //m_DrawList->AddRect(m_WidgetRect.Min, m_WidgetRect.Max, IM_COL32(255, 0, 255, 64)); + m_DrawList->AddRect(m_WidgetRect.Min, m_WidgetRect.Max, IM_COL32(255, 0, 255, 64)); ImGui::SetCursorScreenPos(ImVec2(0.0f, 0.0f)); From 105aeb9bafb33baee69f4591630774cb0b111f6a Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Sun, 25 Jun 2023 14:56:45 -0700 Subject: [PATCH 08/13] Removed operator that's now duplicated in mainline imgui --- imgui_extra_math.inl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/imgui_extra_math.inl b/imgui_extra_math.inl index 13cf9906c..dc4563590 100644 --- a/imgui_extra_math.inl +++ b/imgui_extra_math.inl @@ -34,12 +34,6 @@ inline ImVec2 operator*(const float lhs, const ImVec2& rhs) return ImVec2(lhs * rhs.x, lhs * rhs.y); } -inline ImVec2 operator-(const ImVec2& lhs) -{ - return ImVec2(-lhs.x, -lhs.y); -} - - //------------------------------------------------------------------------------ inline float ImLength(float v) { From f370f77c5fd0074451933069b947110c59e933a7 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Sat, 29 Jul 2023 23:49:24 -0700 Subject: [PATCH 09/13] Grab bug fix from https://github.com/thedmd/imgui-node-editor/pull/186/ --- imgui_node_editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index cd1832432..53223fe26 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -1091,8 +1091,8 @@ void ed::EditorContext::Begin(const char* id, const ImVec2& size) if (!m_IsInitialized) { // Cycle canvas so it has a change to setup its size before settings are loaded - m_Canvas.Begin(id, canvasSize); - m_Canvas.End(); + if(m_Canvas.Begin(id, canvasSize)) + m_Canvas.End(); LoadSettings(); m_IsInitialized = true; From 4ce1884565bf66dafb5266ba8f07b8894a242966 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Fri, 1 Sep 2023 09:17:42 -0700 Subject: [PATCH 10/13] Commented out names of unused parameters to avoid warning about them being unused --- imgui_canvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_canvas.cpp b/imgui_canvas.cpp index 48093e96c..44195ea4e 100644 --- a/imgui_canvas.cpp +++ b/imgui_canvas.cpp @@ -68,7 +68,7 @@ struct VtxCurrentOffsetRef } }; -static void SentinelDrawCallback(const ImDrawList* parent_list, const ImDrawCmd* cmd) +static void SentinelDrawCallback(const ImDrawList* /*parent_list*/, const ImDrawCmd* /*cmd*/) { // This is a sentinel draw callback, it's only purpose is to mark draw list command. //IM_ASSERT(false && "This draw callback should never be called."); From da5bd5171cf9b2ffc4992f5f6b17440b57579999 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Thu, 23 Nov 2023 15:55:19 -0800 Subject: [PATCH 11/13] Fixes to build examples on older imgui --- imgui_extra_math.inl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/imgui_extra_math.inl b/imgui_extra_math.inl index dc4563590..ba2b1bff2 100644 --- a/imgui_extra_math.inl +++ b/imgui_extra_math.inl @@ -34,6 +34,13 @@ inline ImVec2 operator*(const float lhs, const ImVec2& rhs) return ImVec2(lhs * rhs.x, lhs * rhs.y); } +# if IMGUI_VERSION_NUM < 18955 +inline ImVec2 operator-(const ImVec2& lhs) +{ + return ImVec2(-lhs.x, -lhs.y); +} +# endif + //------------------------------------------------------------------------------ inline float ImLength(float v) { From 6b7fe16eafb685505c5aa96b32c13235ce79d8ba Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Tue, 28 Nov 2023 21:08:03 -0800 Subject: [PATCH 12/13] Added workaround for bug that appears to put sentinels at unexpected locations in the draw list, causing crashes --- imgui_canvas.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/imgui_canvas.cpp b/imgui_canvas.cpp index a4dccbc74..6a1504e02 100644 --- a/imgui_canvas.cpp +++ b/imgui_canvas.cpp @@ -561,6 +561,20 @@ void ImGuiEx::Canvas::LeaveLocalSpace() m_DrawList->CmdBuffer.erase(m_DrawList->CmdBuffer.Data + m_DrawListCommadBufferSize); else if (m_DrawList->CmdBuffer.size() >= m_DrawListCommadBufferSize && m_DrawList->CmdBuffer[m_DrawListCommadBufferSize - 1].UserCallback == ImDrawCallback_ImCanvas) m_DrawList->CmdBuffer.erase(m_DrawList->CmdBuffer.Data + m_DrawListCommadBufferSize - 1); + + //DEBUG: Search the *entire* draw list for the sentinel command + for(int i=0; iCmdBuffer.size(); i++) + { + if(m_DrawList->CmdBuffer[i].UserCallback == ImDrawCallback_ImCanvas) + { + /*fprintf(stderr, "found and removed sentinel at offset %d, expected %d or %d\n", + i, + m_DrawListCommadBufferSize, + m_DrawListCommadBufferSize-1);*/ + + m_DrawList->CmdBuffer.erase(m_DrawList->CmdBuffer.Data + i); + } + } } auto& fringeScale = ImFringeScaleRef(m_DrawList); From 6047a3b2cce1f4fbc9e814b71da29eb9cbd7f650 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Mon, 11 Nov 2024 19:59:17 -0800 Subject: [PATCH 13/13] Fixes for functions deprecated in latest imgui --- imgui_node_editor.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index ea11e9dce..4c5451263 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -173,7 +173,6 @@ void ed::Log(const char* fmt, ...) # endif } - //------------------------------------------------------------------------------ static bool IsGroup(const ed::Node* node) { @@ -4398,15 +4397,15 @@ ed::EditorAction::AcceptResult ed::ShortcutAction::Accept(const Control& control Action candidateAction = None; auto& io = ImGui::GetIO(); - if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_X))) + if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_X)) candidateAction = Cut; - if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_C))) + if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_C)) candidateAction = Copy; - if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_V))) + if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_V)) candidateAction = Paste; if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(GetKeyIndexForD())) candidateAction = Duplicate; - if (!io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) + if (!io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_Space)) candidateAction = CreateNode; if (candidateAction != None) @@ -4960,7 +4959,7 @@ ed::EditorAction::AcceptResult ed::DeleteItemsAction::Accept(const Control& cont return False; auto& io = ImGui::GetIO(); - if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Delete)) && Editor->AreShortcutsEnabled()) + if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(ImGuiKey_Delete) && Editor->AreShortcutsEnabled()) { auto& selection = Editor->GetSelectedObjects(); if (!selection.empty())