[PR #17100] Use float instead of double by default #31110

Open
opened 2026-01-31 09:45:11 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17100

State: closed
Merged: Yes


While double is probably generally preferable for UI code,
our application is essentially a complex wrapper wrapper around
DWrite, D2D and D3D, all of which use float exclusively.

Of course it also uses XAML, but that one uses float for roughly
1/3rd of its API functions, so I'm not sure what it prefers.
Additionally, it's mostly a coincidence that we use WinUI/XAML for
Windows Terminal whereas DWrite/D2D/D3D are effectively essential.
This is demonstrated by the fact that we have a HwndTerminal,
while there's no alternative to e.g. D3D on Windows.

The goal of this PR is that DIP based calculations never end up
mixing float and double. This PR also changes opacity-related
values to float because I felt like that fits the theme.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17100 **State:** closed **Merged:** Yes --- While `double` is probably generally preferable for UI code, our application is essentially a complex wrapper wrapper around DWrite, D2D and D3D, all of which use `float` exclusively. Of course it also uses XAML, but that one uses `float` for roughly 1/3rd of its API functions, so I'm not sure what it prefers. Additionally, it's mostly a coincidence that we use WinUI/XAML for Windows Terminal whereas DWrite/D2D/D3D are effectively essential. This is demonstrated by the fact that we have a `HwndTerminal`, while there's no alternative to e.g. D3D on Windows. The goal of this PR is that DIP based calculations never end up mixing `float` and `double`. This PR also changes opacity-related values to `float` because I felt like that fits the theme.
claunia added the pull-request label 2026-01-31 09:45:11 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31110