Skip to content

Adjust rendering of the inline tag#49087

Merged
CyrusNajmabadi merged 2 commits intodotnet:masterfrom
CyrusNajmabadi:inlineTagSize
Oct 31, 2020
Merged

Adjust rendering of the inline tag#49087
CyrusNajmabadi merged 2 commits intodotnet:masterfrom
CyrusNajmabadi:inlineTagSize

Conversation

@CyrusNajmabadi
Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi commented Oct 30, 2020

Fixes #48794

Moves us from looking like this:

image

to:

image

This also keeps our baselines aligned, making text not feel off balance from the surrounding lines:

image

--

Note: i would like the top spacing to be about 1px less. However, i couldn't find any system that would make that work reliably without going off the rails elsewhere with some combination of font/zoom/text-size. The current approach worked universally for as many cases as i tried (i.e. zoom-levels from 80% to 400%, and font sizes from 8pt to 24pt.)

@gundermanc if there are any ideas on what could be done here.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner October 30, 2020 22:08
@CyrusNajmabadi CyrusNajmabadi requested a review from a team October 30, 2020 22:08
Copy link
Member

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

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

The parentheses in the after screenshot is unrelated, right? Because if they're hiding in the code somewhere I can't see 'em 😄

Comment on lines -164 to -166
// Need to set SnapsToDevicePixels and UseLayoutRounding to avoid unnecessary reformatting
SnapsToDevicePixels = textView.VisualElement.SnapsToDevicePixels,
UseLayoutRounding = textView.VisualElement.UseLayoutRounding,
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ Is this no longer the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope. and it's actually problematic. the highlight rect doesn't do this, and it means we more often than not show up misaligned with it.

@JoeRobich
Copy link
Member

How nitpicky do we want to be here?
image

@CyrusNajmabadi
Copy link
Contributor Author

The parentheses in the after screenshot is unrelated, right? Because if they're hiding in the code somewhere I can't see 'em

Yeah, it's not an exact before/after. i was playing around with lots of stuff.

@CyrusNajmabadi
Copy link
Contributor Author

How nitpicky do we want to be here?

still much better than where we are currently (where we're off by full pixels). :)

Note: i'm ok with an alternate approach here. but it's a bit challenging here to get everything to work perfect here.

@CyrusNajmabadi CyrusNajmabadi merged commit 045f9c4 into dotnet:master Oct 31, 2020
@ghost ghost added this to the Next milestone Oct 31, 2020
@CyrusNajmabadi CyrusNajmabadi deleted the inlineTagSize branch November 2, 2020 00:45
@allisonchou allisonchou modified the milestones: Next, 16.9.P2 Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline Hints render slightly off-center (or at least appear that way relative to the line guidelines)

6 participants