Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix font size rounding in the settings UI #14040

Merged
merged 3 commits into from
Sep 20, 2022
Merged

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Sep 19, 2022

This fixes an issue with c51bb3a, where some fractional font
sizes are displayed as something like 13.600000000001.

Closes #14024

Validation Steps Performed

  • Enter a font size of 13.6 and save
  • NumberBox displays "13.6" ✅

// issues when displaying 32-bit floats, because WinUI is unaware about their existence.
SignificantDigitsNumberRounder rounder;
rounder.SignificantDigits(6);
_fontSizeBox().NumberFormatter().as<DecimalFormatter>().NumberRounder(rounder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes. This is an implementation detail, but i no longer care :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you //BODGY this?

// issues when displaying 32-bit floats, because WinUI is unaware about their existence.
SignificantDigitsNumberRounder rounder;
rounder.SignificantDigits(6);
_fontSizeBox().NumberFormatter().as<DecimalFormatter>().NumberRounder(rounder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you //BODGY this?

@ghost ghost added Area-SettingsUI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. labels Sep 19, 2022
@DHowett DHowett merged commit f79276b into main Sep 20, 2022
@DHowett DHowett deleted the dev/lhecker/14024-winui branch September 20, 2022 17:36
DHowett pushed a commit that referenced this pull request Sep 21, 2022
This fixes an issue with c51bb3a, where some fractional font
sizes are displayed as something like 13.600000000001.

Closes #14024

## Validation Steps Performed
* Enter a font size of 13.6 and save
* NumberBox displays "13.6" ✅

(cherry picked from commit f79276b)
Service-Card-Id: 85740785
Service-Version: 1.16
@ghost
Copy link

ghost commented Sep 23, 2022

🎉Windows Terminal Preview v1.16.2641.0 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-SettingsUI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Odd behavior when using fractional font size in SUI
2 participants