BodyAddChild PopupContext needs to happen immediately upon triggering it.
PiperOrigin-RevId: 881955422 Change-Id: I03675431d78c93550ff2ad6d562daf1a0e3d0d08
This commit is contained in:
committed by
Copybara-Service
parent
acf7f030a6
commit
df02fe4bc0
@@ -93,12 +93,6 @@ static void AddEditorButtons(mjsElement* element, mjsElement** selected_element,
|
||||
if (ImGui::SmallButton(ICON_FA_PLUS)) {
|
||||
ImGui::OpenPopupOnItemClick("BodyAddChild", 0);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
}
|
||||
if (ImGui::SmallButton(ICON_FA_TRASH_CAN)) {
|
||||
editor.DeleteActiveElement();
|
||||
*selected_element = nullptr;
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupContextItem("BodyAddChild")) {
|
||||
mjsBody* body = mjs_asBody(element);
|
||||
@@ -115,6 +109,13 @@ static void AddEditorButtons(mjsElement* element, mjsElement** selected_element,
|
||||
option("Site", mjOBJ_SITE);
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
}
|
||||
if (ImGui::SmallButton(ICON_FA_TRASH_CAN)) {
|
||||
editor.DeleteActiveElement();
|
||||
*selected_element = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
static void SelectableElement(mjsElement* element,
|
||||
|
||||
Reference in New Issue
Block a user