Skip to content

Commit

Permalink
Remove usage of PushOverrideID when changing between view/layout
Browse files Browse the repository at this point in the history
Because we don't need it anymore and because we can't.

Dockspace need to have a stable ID, if its parent ID changes then
dock widgets appear all out of place.

We don't need it because the plots are now inside their own window
(ImGui::Begin), they have a stable ID, and zoom is preserved

Signed-off-by: Sergio Martins <[email protected]>
  • Loading branch information
iamsergio committed Nov 29, 2024
1 parent b3c0f95 commit 074f51a
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/ui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,18 +407,11 @@ static void main_loop(void* arg) {
components::Toolbar(app->toolbarBlocks);
}

ImGuiID viewId = 0;
if (app->mainViewMode == ViewMode::VIEW) {
if (app->dashboard != nullptr) {
app->dashboardPage.draw(*app->dashboard);
}
} else if (app->mainViewMode == ViewMode::LAYOUT) {
// The ID of this tab is different from the ID of the view tab. That means that the plots in the two tabs
// are considered to be different plots, so changing e.g. the zoom level of a plot in the view tab would
// not reflect in the layout tab.
// To fix that we use the PushOverrideID() function to force the ID of this tab to be the same as the ID
// of the view tab.
IMW::OverrideId overrideId(viewId);
if (app->dashboard != nullptr) {
app->dashboardPage.draw(*app->dashboard, DashboardPage::Mode::Layout);
}
Expand Down

0 comments on commit 074f51a

Please sign in to comment.