Adjust rendering of the inline tag#49087
Conversation
davidwengier
left a comment
There was a problem hiding this comment.
The parentheses in the after screenshot is unrelated, right? Because if they're hiding in the code somewhere I can't see 'em 😄
| // Need to set SnapsToDevicePixels and UseLayoutRounding to avoid unnecessary reformatting | ||
| SnapsToDevicePixels = textView.VisualElement.SnapsToDevicePixels, | ||
| UseLayoutRounding = textView.VisualElement.UseLayoutRounding, |
There was a problem hiding this comment.
❔ Is this no longer the case?
There was a problem hiding this comment.
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.
Yeah, it's not an exact before/after. i was playing around with lots of stuff. |
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. |

Fixes #48794
Moves us from looking like this:
to:
This also keeps our baselines aligned, making text not feel off balance from the surrounding lines:
--
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.