diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.cpp b/src/cascadia/TerminalSettingsEditor/Appearances.cpp index e9760b88606..49d3082350e 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.cpp +++ b/src/cascadia/TerminalSettingsEditor/Appearances.cpp @@ -91,6 +91,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation { InitializeComponent(); + { + using namespace winrt::Windows::Globalization::NumberFormatting; + // > .NET rounds to 12 significant digits when displaying doubles, so we will [...] + // ...obviously not do that, because this is an UI element for humans. This prevents + // issues when displaying 32-bit floats, because WinUI is unaware about their existence. + SignificantDigitsNumberRounder rounder; + rounder.SignificantDigits(6); + // BODGY: Depends on WinUI internals. + _fontSizeBox().NumberFormatter().as().NumberRounder(rounder); + } + INITIALIZE_BINDABLE_ENUM_SETTING(CursorShape, CursorStyle, winrt::Microsoft::Terminal::Core::CursorStyle, L"Profile_CursorShape", L"Content"); INITIALIZE_BINDABLE_ENUM_SETTING(AdjustIndistinguishableColors, AdjustIndistinguishableColors, winrt::Microsoft::Terminal::Core::AdjustTextMode, L"Profile_AdjustIndistinguishableColors", L"Content"); INITIALIZE_BINDABLE_ENUM_SETTING_REVERSE_ORDER(BackgroundImageStretchMode, BackgroundImageStretchMode, winrt::Windows::UI::Xaml::Media::Stretch, L"Profile_BackgroundImageStretchMode", L"Content"); diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.xaml b/src/cascadia/TerminalSettingsEditor/Appearances.xaml index 2b00dbe545c..2e348581216 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.xaml +++ b/src/cascadia/TerminalSettingsEditor/Appearances.xaml @@ -93,7 +93,8 @@ HasSettingValue="{x:Bind Appearance.HasFontSize, Mode=OneWay}" SettingOverrideSource="{x:Bind Appearance.FontSizeOverrideSource, Mode=OneWay}" Visibility="{x:Bind Appearance.IsDefault, Mode=OneWay}"> - #include #include +#include #include #include #include