-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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 coordSizeUnscaled calculation in AtlasEngine #13384
Conversation
i kept noticing that and it was rubbing me the wrong way every time |
{ | ||
// The coordSizeUnscaled parameter to SetFromEngine is used for API functions like GetConsoleFontSize. | ||
// Since clients expect that settings the font height to Y yields back a font height of Y, | ||
// we're scaling the X relative/proportional to the actual cellWidth/cellHeight ratio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not totally understand what is happening here :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It assumes this to be true (mathematically speaking):
requestedSize.X / requestedSize.Y == coordSize.X / coordSize.Y
and thus computes requestedSize.X
via:
requestedSize.X = requestedSize.Y * coordSize.X / coordSize.Y
DxEngine and AtlasEngine use the given requestedSize.Y
as the font height in DIPs and add the line "paddings" on top of it, whereas GdiEngine uses it as the cell height.
I'm not sure how to best calculate the requestedSize.X
, but this seems like a viable approach. I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me!
@msftbot merge this in 5 minutes |
Hello @carlos-zamora! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
🎉 Handy links: |
This commit fixes a bug causing the OpenConsole to get increasingly larger
every time the font is changed when the AtlasEngine is active.
The only impact this bug had on Windows Terminal is that the
font-size
in HTML and RTF selection copies are too large.Validation Steps Performed
switching between main and alt buffer ✅