diff --git a/doc/changelog.rst b/doc/changelog.rst index 183dc496..151c6ebf 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -2,6 +2,14 @@ Changelog ========= +Upcoming version (not yet released) +----------------------------------- + +Bug fixes +^^^^^^^^^ + +1. Fix in simulate: correct handling of "Pause update", "Fullscreen" and "VSync" buttons. + Version 3.0.0 (October 18, 2023) -------------------------------- diff --git a/simulate/simulate.cc b/simulate/simulate.cc index 5a64019f..32d6ec7a 100644 --- a/simulate/simulate.cc +++ b/simulate/simulate.cc @@ -1343,28 +1343,18 @@ void UiEvent(mjuiState* state) { // option section else if (it && it->sectionid==SECT_OPTION) { - switch (it->itemid) { - case 0: // Spacing + if (it->pdata == &sim->spacing) { sim->ui0.spacing = mjui_themeSpacing(sim->spacing); sim->ui1.spacing = mjui_themeSpacing(sim->spacing); - break; - - case 1: // Color + } else if (it->pdata == &sim->color) { sim->ui0.color = mjui_themeColor(sim->color); sim->ui1.color = mjui_themeColor(sim->color); - break; - - case 2: // Font + } else if (it->pdata == &sim->font) { mjr_changeFont(50*(sim->font+1), &sim->platform_ui->mjr_context()); - break; - - case 9: // Full screen + } else if (it->pdata == &sim->fullscreen) { sim->platform_ui->ToggleFullscreen(); - break; - - case 10: // Vertical sync + } else if (it->pdata == &sim->vsync) { sim->platform_ui->SetVSync(sim->vsync); - break; } // modify UI