Skip to content

Commit

Permalink
if remoting, can call ScaleAllSizes
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Apr 17, 2024
1 parent 5cbc334 commit 5791593
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hello_imgui/internal/backend_impls/abstract_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ bool _CheckDpiAwareParamsChanges(HelloImGui::RunnerParams& params)
didFontLoadingRatioChangeOnRemoteServer = true;

float oldDpiWindowSizeFactor = dpiAwareParams.dpiWindowSizeFactor;
dpiAwareParams.dpiWindowSizeFactor = dpiAwareParams.dpiWindowSizeFactor * newFontLoadingRatio / currentFontLoadingRatio;
float ratioScaling = newFontLoadingRatio / currentFontLoadingRatio;
dpiAwareParams.dpiWindowSizeFactor = dpiAwareParams.dpiWindowSizeFactor * ratioScaling;
ImGui::GetStyle().ScaleAllSizes(ratioScaling);
float new_diff = fabs(dpiAwareParams.DpiFontLoadingFactor() - newFontLoadingRatio);
IM_ASSERT(new_diff < 0.001f);
printf("Warning: didFontLoadingRatioChange=true \n"
Expand Down

0 comments on commit 5791593

Please sign in to comment.