FIX: crash when multi-select connectors with different shape

Jira: 3916
Change-Id: Ic011827e5d301f91f684039a85b228196be1ba98
(cherry picked from commit 53705d8541a6d97ada278ea9310ac6e5e1ac45c7)
This commit is contained in:
zhimin.zeng 2023-08-25 11:22:39 +08:00 committed by Lane.Wei
parent ef2cc4b65c
commit b0e20ad68e

View file

@ -1710,7 +1710,8 @@ bool GLGizmoAdvancedCut::render_combo(const std::string &label, const std::vecto
size_t selection_out = selection_idx; size_t selection_out = selection_idx;
if (ImGui::BBLBeginCombo(("##" + label).c_str(), lines[selection_idx].c_str(), 0)) { const char* selected_str = (selection_idx >= 0 && selection_idx < int(lines.size())) ? lines[selection_idx].c_str() : "";
if (ImGui::BBLBeginCombo(("##" + label).c_str(), selected_str, 0)) {
for (size_t line_idx = 0; line_idx < lines.size(); ++line_idx) { for (size_t line_idx = 0; line_idx < lines.size(); ++line_idx) {
ImGui::PushID(int(line_idx)); ImGui::PushID(int(line_idx));
if (ImGui::Selectable("", line_idx == selection_idx)) if (ImGui::Selectable("", line_idx == selection_idx))