(Breaking) Fonts: obsoleting SetWindowFontScale().

+ Comments

# Conflicts:
#	imgui.cpp
This commit is contained in:
ocornut
2025-06-02 14:58:30 +02:00
parent 59a11363a5
commit 80c08f2286
3 changed files with 18 additions and 10 deletions

View File

@@ -8485,11 +8485,11 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
"However, the _correct_ way of scaling your UI is currently to reload your font at the designed size, "
"rebuild the font atlas, and call style.ScaleAllSizes() on a reference ImGuiStyle structure.\n"
"Using those settings here will give you poor quality results.");
static float window_scale = 1.0f;
PushItemWidth(GetFontSize() * 8);
if (DragFloat("window scale", &window_scale, 0.005f, MIN_SCALE, MAX_SCALE, "%.2f", ImGuiSliderFlags_AlwaysClamp)) // Scale only this window
SetWindowFontScale(window_scale);
DragFloat("global scale", &io.FontGlobalScale, 0.005f, MIN_SCALE, MAX_SCALE, "%.2f", ImGuiSliderFlags_AlwaysClamp); // Scale everything
//static float window_scale = 1.0f;
//if (DragFloat("window scale", &window_scale, 0.005f, MIN_SCALE, MAX_SCALE, "%.2f", ImGuiSliderFlags_AlwaysClamp)) // Scale only this window
// SetWindowFontScale(window_scale);
PopItemWidth();
EndTabItem();