Correctly handle full screen and vsync buttons.
Fixes #1110.
The code was using outdated indices since 48eb75ae92. It now uses the more stable pdata pointer.
PiperOrigin-RevId: 574805349
Change-Id: If6112fb2af7d60f17b35599233b24f33b6a8cac6
This commit is contained in:
committed by
Copybara-Service
parent
44ba099fd6
commit
9393c690d4
@@ -2,6 +2,14 @@
|
|||||||
Changelog
|
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)
|
Version 3.0.0 (October 18, 2023)
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
|
|||||||
+5
-15
@@ -1343,28 +1343,18 @@ void UiEvent(mjuiState* state) {
|
|||||||
|
|
||||||
// option section
|
// option section
|
||||||
else if (it && it->sectionid==SECT_OPTION) {
|
else if (it && it->sectionid==SECT_OPTION) {
|
||||||
switch (it->itemid) {
|
if (it->pdata == &sim->spacing) {
|
||||||
case 0: // Spacing
|
|
||||||
sim->ui0.spacing = mjui_themeSpacing(sim->spacing);
|
sim->ui0.spacing = mjui_themeSpacing(sim->spacing);
|
||||||
sim->ui1.spacing = mjui_themeSpacing(sim->spacing);
|
sim->ui1.spacing = mjui_themeSpacing(sim->spacing);
|
||||||
break;
|
} else if (it->pdata == &sim->color) {
|
||||||
|
|
||||||
case 1: // Color
|
|
||||||
sim->ui0.color = mjui_themeColor(sim->color);
|
sim->ui0.color = mjui_themeColor(sim->color);
|
||||||
sim->ui1.color = mjui_themeColor(sim->color);
|
sim->ui1.color = mjui_themeColor(sim->color);
|
||||||
break;
|
} else if (it->pdata == &sim->font) {
|
||||||
|
|
||||||
case 2: // Font
|
|
||||||
mjr_changeFont(50*(sim->font+1), &sim->platform_ui->mjr_context());
|
mjr_changeFont(50*(sim->font+1), &sim->platform_ui->mjr_context());
|
||||||
break;
|
} else if (it->pdata == &sim->fullscreen) {
|
||||||
|
|
||||||
case 9: // Full screen
|
|
||||||
sim->platform_ui->ToggleFullscreen();
|
sim->platform_ui->ToggleFullscreen();
|
||||||
break;
|
} else if (it->pdata == &sim->vsync) {
|
||||||
|
|
||||||
case 10: // Vertical sync
|
|
||||||
sim->platform_ui->SetVSync(sim->vsync);
|
sim->platform_ui->SetVSync(sim->vsync);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// modify UI
|
// modify UI
|
||||||
|
|||||||
Reference in New Issue
Block a user