diff --git a/CMakeLists.txt b/CMakeLists.txt index dec6807e..cfe4f3be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # CMakeList.txt : CMake project for FastNoise cmake_minimum_required(VERSION 3.7.1) -project(FastNoise2 VERSION 0.8.0) +project(FastNoise2 VERSION 0.8.1) set(CMAKE_CXX_STANDARD 17) option(FASTNOISE2_NOISETOOL "Build Noise Tool" ON) diff --git a/NoiseTool/FastNoiseNodeEditor.cpp b/NoiseTool/FastNoiseNodeEditor.cpp index 5623a058..60ca8603 100644 --- a/NoiseTool/FastNoiseNodeEditor.cpp +++ b/NoiseTool/FastNoiseNodeEditor.cpp @@ -394,10 +394,11 @@ void FastNoiseNodeEditor::CheckLinks() void FastNoiseNodeEditor::UpdateSelected() { std::vector linksToDelete; + int selectedLinkCount = imnodes::NumSelectedLinks(); - if( int selectedCount = imnodes::NumSelectedLinks() && ImGui::IsKeyPressed( ImGui::GetKeyIndex( ImGuiKey_Delete ), false ) ) + if( selectedLinkCount && ImGui::IsKeyPressed( ImGui::GetKeyIndex( ImGuiKey_Delete ), false ) ) { - linksToDelete.resize( selectedCount ); + linksToDelete.resize( selectedLinkCount ); imnodes::GetSelectedLinks( linksToDelete.data() ); } @@ -432,9 +433,11 @@ void FastNoiseNodeEditor::UpdateSelected() } } - if( int selectedCount = imnodes::NumSelectedNodes() && ImGui::IsKeyPressed( ImGui::GetKeyIndex( ImGuiKey_Delete ), false ) ) + int selectedNodeCount = imnodes::NumSelectedNodes(); + + if( selectedNodeCount && ImGui::IsKeyPressed( ImGui::GetKeyIndex( ImGuiKey_Delete ), false ) ) { - std::vector selected( selectedCount ); + std::vector selected( selectedNodeCount ); imnodes::GetSelectedNodes( selected.data() );