Skip to content

Fix inlay hints being offset by 1px in some cases#153424

Merged
jrieken merged 1 commit intomicrosoft:mainfrom
TheV360:main
Jun 29, 2022
Merged

Fix inlay hints being offset by 1px in some cases#153424
jrieken merged 1 commit intomicrosoft:mainfrom
TheV360:main

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