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 inlay hints being offset by 1px in some cases #153424

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Conversation

TheV360
Copy link
Contributor

@TheV360 TheV360 commented Jun 28, 2022

This PR fixes #153419

VS Code previously applied the vertical-align: middle CSS rule to all hints, even those that have the same font style as the editor's. This results in inlay hints being 1px lower than they should be.

2022-06-22_17-39-32_Code

This pull request adds the isUniform flag to _getLayoutInfo()'s output. It indicates if the inlay hint styles and editor styles match. If they do, the vertical-align rule is set to baseline, effectively disabling it.

VS Code previously applied the `vertical-align: middle` CSS rule to all hints,
even those that have the same font style as the editor's. This results in
inlay hints being 1px lower than they should be.

This pull request adds the `isUniform` flag to `_getLayoutInfo()`'s output. It
indicates if the inlay hint styles and editor styles match. If they do, the
`vertical-align` rule is set to `baseline`, effectively disabling it.
@jrieken jrieken added this to the June 2022 milestone Jun 29, 2022
@jrieken
Copy link
Member

jrieken commented Jun 29, 2022

Thanks @TheV360. Looking much better ✨

Screenshot 2022-06-29 at 11 51 02

@jrieken jrieken merged commit 1d6b9d6 into microsoft:main Jun 29, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inlay hints are offset by 1px in some cases
3 participants