Merge pull request #791 from Aireil/fix_crash_slider

fix: clamp settings sliders
This commit is contained in:
goaaats 2022-04-14 14:02:07 +02:00 committed by GitHub
commit ee0f684226
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -353,7 +353,7 @@ namespace Dalamud.Interface.Internal.Windows
interfaceManager.RebuildFonts(); interfaceManager.RebuildFonts();
} }
if (ImGui.DragFloat("##DalamudSettingsGlobalUiScaleDrag", ref this.globalUiScale, 0.005f, MinScale, MaxScale, "%.2f")) if (ImGui.DragFloat("##DalamudSettingsGlobalUiScaleDrag", ref this.globalUiScale, 0.005f, MinScale, MaxScale, "%.2f", ImGuiSliderFlags.AlwaysClamp))
{ {
ImGui.GetIO().FontGlobalScale = this.globalUiScale; ImGui.GetIO().FontGlobalScale = this.globalUiScale;
interfaceManager.RebuildFonts(); interfaceManager.RebuildFonts();
@ -440,7 +440,7 @@ namespace Dalamud.Interface.Internal.Windows
interfaceManager.RebuildFonts(); interfaceManager.RebuildFonts();
} }
if (ImGui.DragFloat("##DalamudSettingsFontGammaDrag", ref this.fontGamma, 0.005f, MinScale, MaxScale, "%.2f")) if (ImGui.DragFloat("##DalamudSettingsFontGammaDrag", ref this.fontGamma, 0.005f, MinScale, MaxScale, "%.2f", ImGuiSliderFlags.AlwaysClamp))
{ {
interfaceManager.FontGammaOverride = this.fontGamma; interfaceManager.FontGammaOverride = this.fontGamma;
interfaceManager.RebuildFonts(); interfaceManager.RebuildFonts();