@@ -50,7 +50,6 @@ bool unshowRequested = false;
5050
5151// Some state about imgui windows to stack them
5252constexpr float INITIAL_LEFT_WINDOWS_WIDTH = 305 ;
53- constexpr float INITIAL_RIGHT_WINDOWS_WIDTH = 500 ;
5453
5554auto prevMainLoopTime = std::chrono::steady_clock::now();
5655float rollingMainLoopDurationMicrosec = 0 .;
@@ -137,13 +136,14 @@ void writePrefsFile() {
137136
138137void setInitialWindowWidths () {
139138 internal::leftWindowsWidth = INITIAL_LEFT_WINDOWS_WIDTH * options::uiScale;
140- internal::rightWindowsWidth = INITIAL_RIGHT_WINDOWS_WIDTH * options::uiScale;
139+ internal::rightWindowsWidth = options::rightGuiPaneWidth * options::uiScale;
141140}
142141
143142void ensureWindowWidthsSet () {
144143 if (internal::leftWindowsWidth <= 0 . || internal::rightWindowsWidth <= 0 .) {
145144 setInitialWindowWidths ();
146145 }
146+ internal::rightWindowsWidth = options::rightGuiPaneWidth * options::uiScale;
147147}
148148
149149// Helper to get a structure map
@@ -683,16 +683,18 @@ void userGuiBegin() {
683683 // right side
684684 userGuiLoc = ImVec2 (view::windowWidth - (internal::rightWindowsWidth + internal::imguiStackMargin),
685685 internal::imguiStackMargin);
686+
686687 ImGui::SetNextWindowSize (ImVec2 (internal::rightWindowsWidth, 0 .));
687688 } else {
688689 // left side
689690 if (options::buildDefaultGuiPanels) {
690- userGuiLoc = ImVec2 (internal::leftWindowsWidth + 3 * internal::imguiStackMargin, internal::imguiStackMargin);
691+ userGuiLoc = ImVec2 (internal::leftWindowsWidth + 2 * internal::imguiStackMargin, internal::imguiStackMargin);
691692 } else {
692693 userGuiLoc = ImVec2 (internal::imguiStackMargin, internal::imguiStackMargin);
693694 }
694695 }
695696
697+
696698 ImGui::PushID (" user_callback" );
697699 ImGui::SetNextWindowPos (userGuiLoc);
698700
@@ -702,7 +704,6 @@ void userGuiBegin() {
702704void userGuiEnd () {
703705
704706 if (options::userGuiIsOnRightSide) {
705- internal::rightWindowsWidth = INITIAL_RIGHT_WINDOWS_WIDTH * options::uiScale;
706707 internal::lastWindowHeightUser =
707708 internal::imguiStackMargin + ImGui::GetWindowHeight (); // TODO using deprecated function
708709 internal::lastRightSideFreeX = view::windowWidth - internal::imguiStackMargin;
0 commit comments