In simulate UI, clear shortcut string for flags with no shortcuts.

PiperOrigin-RevId: 478467279
Change-Id: Icc4317d9e35b41871143572275d03adf7e13d956
This commit is contained in:
Kevin Zakka
2022-10-03 04:30:26 -07:00
committed by Copybara-Service
parent 52c415eb80
commit 7e89d8dab0
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -703,7 +703,11 @@ void makerendering(mj::Simulate* sim, int oldstate) {
}
// set shortcut and data
mju::sprintf_arr(defFlag[0].other, " %s", mjVISSTRING[i][2]);
if (mjVISSTRING[i][2][0]) {
mju::sprintf_arr(defFlag[0].other, " %s", mjVISSTRING[i][2]);
} else {
mju::sprintf_arr(defFlag[0].other, "");
}
defFlag[0].pdata = sim->vopt.flags + i;
mjui_add(&sim->ui0, defFlag);
}
@@ -712,6 +716,8 @@ void makerendering(mj::Simulate* sim, int oldstate) {
mju::strcpy_arr(defFlag[0].name, mjRNDSTRING[i][0]);
if (mjRNDSTRING[i][2][0]) {
mju::sprintf_arr(defFlag[0].other, " %s", mjRNDSTRING[i][2]);
} else {
mju::sprintf_arr(defFlag[0].other, "");
}
defFlag[0].pdata = sim->scn.flags + i;
mjui_add(&sim->ui0, defFlag);
+1 -1
View File
@@ -1027,7 +1027,7 @@ static void setcursor(mjrRect r, mjUI* ui, const mjuiState* ins, const mjrContex
// parse modifier and shortcut
static void parseshortcut(const char* text, int* mod, int* key) {
// cleear
// clear
*mod = 0;
*key = 0;