Skip to content

Commit

Permalink
Updated to fix imgui breaking backwards comp: ocornut/imgui#4921
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankielnielsen committed Feb 9, 2024
1 parent 05c7546 commit ce7bb80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions example/color_node_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <imnodes.h>
#include <imgui.h>

#include <SDL2/SDL_keycode.h>
#include <SDL2/SDL_timer.h>
#include <SDL_keycode.h>
#include <SDL_timer.h>
#include <algorithm>
#include <cassert>
#include <chrono>
Expand Down Expand Up @@ -207,7 +207,7 @@ class ColorNodeEditor
{
const bool open_popup = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) &&
ImNodes::IsEditorHovered() &&
ImGui::IsKeyReleased(SDL_SCANCODE_A);
ImGui::IsKeyReleased(ImGuiKey_A);

ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8.f, 8.f));
if (!ImGui::IsAnyItemHovered() && open_popup)
Expand Down Expand Up @@ -588,7 +588,7 @@ class ColorNodeEditor

{
const int num_selected = ImNodes::NumSelectedLinks();
if (num_selected > 0 && ImGui::IsKeyReleased(SDL_SCANCODE_X))
if (num_selected > 0 && ImGui::IsKeyReleased(ImGuiKey_X))
{
static std::vector<int> selected_links;
selected_links.resize(static_cast<size_t>(num_selected));
Expand All @@ -602,7 +602,7 @@ class ColorNodeEditor

{
const int num_selected = ImNodes::NumSelectedNodes();
if (num_selected > 0 && ImGui::IsKeyReleased(SDL_SCANCODE_X))
if (num_selected > 0 && ImGui::IsKeyReleased(ImGuiKey_X))
{
static std::vector<int> selected_nodes;
selected_nodes.resize(static_cast<size_t>(num_selected));
Expand Down
2 changes: 1 addition & 1 deletion example/save_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SaveLoadEditor
ImNodes::BeginNodeEditor();

if (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) &&
ImNodes::IsEditorHovered() && ImGui::IsKeyReleased(SDL_SCANCODE_A))
ImNodes::IsEditorHovered() && ImGui::IsKeyReleased(ImGuiKey_A))
{
const int node_id = ++current_id_;
ImNodes::SetNodeScreenSpacePos(node_id, ImGui::GetMousePos());
Expand Down

0 comments on commit ce7bb80

Please sign in to comment.