@@ -47,8 +47,10 @@ bool unshowRequested = false;
4747float imguiStackMargin = 10 ;
4848float lastWindowHeightPolyscope = 200 ;
4949float lastWindowHeightUser = 200 ;
50- float leftWindowsWidth = 305 ;
51- float rightWindowsWidth = 500 ;
50+ constexpr float LEFT_WINDOWS_WIDTH = 305 ;
51+ constexpr float RIGHT_WINDOWS_WIDTH = 500 ;
52+ float leftWindowsWidth = LEFT_WINDOWS_WIDTH;
53+ float rightWindowsWidth = RIGHT_WINDOWS_WIDTH;
5254
5355auto lastMainLoopIterTime = std::chrono::steady_clock::now();
5456
@@ -554,7 +556,7 @@ void userGuiBegin() {
554556void userGuiEnd () {
555557
556558 if (options::userGuiIsOnRightSide) {
557- rightWindowsWidth = ImGui::GetWindowWidth () ;
559+ rightWindowsWidth = RIGHT_WINDOWS_WIDTH * state::globalContext. dpiScale ;
558560 lastWindowHeightUser = imguiStackMargin + ImGui::GetWindowHeight ();
559561 } else {
560562 lastWindowHeightUser = 0 ;
@@ -645,7 +647,7 @@ void buildPolyscopeGui() {
645647 ImGui::Text (" Rolling: %.1f ms/frame (%.1f fps)" , 1000 .0f / ImGui::GetIO ().Framerate , ImGui::GetIO ().Framerate );
646648 ImGui::Text (" Last: %.1f ms/frame (%.1f fps)" , ImGui::GetIO ().DeltaTime * 1000 .f , 1 .f / ImGui::GetIO ().DeltaTime );
647649
648- ImGui::PushItemWidth (40 );
650+ ImGui::PushItemWidth (40 * state::globalContext. dpiScale );
649651 if (ImGui::InputInt (" max fps" , &options::maxFPS, 0 )) {
650652 if (options::maxFPS < 1 && options::maxFPS != -1 ) {
651653 options::maxFPS = -1 ;
@@ -679,7 +681,7 @@ void buildPolyscopeGui() {
679681
680682
681683 lastWindowHeightPolyscope = imguiStackMargin + ImGui::GetWindowHeight ();
682- leftWindowsWidth = ImGui::GetWindowWidth () ;
684+ leftWindowsWidth = LEFT_WINDOWS_WIDTH * state::globalContext. dpiScale ;
683685
684686 ImGui::End ();
685687}
@@ -748,7 +750,7 @@ void buildStructureGui() {
748750 ImGui::PopID ();
749751 }
750752
751- leftWindowsWidth = ImGui::GetWindowWidth () ;
753+ leftWindowsWidth = LEFT_WINDOWS_WIDTH * state::globalContext. dpiScale ;
752754
753755 ImGui::End ();
754756}
@@ -767,7 +769,7 @@ void buildPickGui() {
767769 ImGui::Separator ();
768770 selection.first ->buildPickUI (selection.second );
769771
770- rightWindowsWidth = ImGui::GetWindowWidth () ;
772+ rightWindowsWidth = RIGHT_WINDOWS_WIDTH * state::globalContext. dpiScale ;
771773 ImGui::End ();
772774 }
773775}
0 commit comments