diff --git a/nn-editor/ncnnloader.cpp b/nn-editor/ncnnloader.cpp index 6d31843..f7ac4e3 100644 --- a/nn-editor/ncnnloader.cpp +++ b/nn-editor/ncnnloader.cpp @@ -165,13 +165,16 @@ void ncnnLoader::nodesToFile(const std::deque& nodes, const std::string& f std::vector v; for (auto& kv : n->values) { - if (string_to_int_[n->type].count(kv.first)) + if (!kv.second.empty()) { - v.push_back(string_to_int_[n->type][kv.first] + "=" + kv.second + " "); - } - else - { - v.push_back(kv.first + "=" + kv.second + " "); + if (string_to_int_[n->type].count(kv.first)) + { + v.push_back(string_to_int_[n->type][kv.first] + "=" + kv.second + " "); + } + else + { + v.push_back(kv.first + "=" + kv.second + " "); + } } } std::sort(v.begin(), v.end()); @@ -211,6 +214,13 @@ void ncnnLoader::refreshNodeValues(Node& n) n.values[kv[0]] = kv[1]; } } + for (auto& kv: string_to_int_[n.type]) + { + if (!n.values.count(kv.first) && kv.first!="") + { + n.values[kv.first] = ""; + } + } } n.text = ""; } diff --git a/nn-editor/nn_editor.cpp b/nn-editor/nn_editor.cpp index 336768f..0f6db70 100644 --- a/nn-editor/nn_editor.cpp +++ b/nn-editor/nn_editor.cpp @@ -345,7 +345,7 @@ class ColorNodeEditor public: SDL_Event event; - ColorNodeEditor() : nodes_(), root_node_id_(-1), + ColorNodeEditor() : minimap_location_(ImNodesMiniMapLocation_BottomRight) { loader_ = create_loader(""); @@ -712,7 +712,8 @@ class ColorNodeEditor loader_->refreshNodeValues(node); if (ImGui::BeginTable("value", 2, 0, { node_width, 0 })) { - ImGui::TableSetupColumn("value", ImGuiTableColumnFlags_WidthFixed, 80); + ImGui::TableSetupColumn("value1", ImGuiTableColumnFlags_WidthFixed, 120); + ImGui::TableSetupColumn("value2", ImGuiTableColumnFlags_WidthFixed, 60); for (auto& kv : node.values) { ImGui::TableNextColumn();