Skip to content

Commit d58f304

Browse files
authored
fix: gutter testing spinner icon broken due to line height (microsoft#187081)
Getting the "wobble" entirely out was annoying. I initially assumed the countainer had to be either an odd or dimension for flexbox to center the icon, but this seemed to not be sufficient. For example, a line height of 36 and 40 were wobble-free, but 38 was not. So instead take a sledgehammer at spinning icons and center them with a transform position. Fixes microsoft#183269
1 parent bbed10d commit d58f304

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,17 @@
1616
position: absolute;
1717
display: flex;
1818
align-items: center;
19+
justify-content: center;
20+
}
21+
22+
/*
23+
Ensure spinning icons are pixel-perfectly centered and avoid wobble.
24+
This is only applied to icons that spin to avoid unnecessary
25+
GPU layers and blurry subpixel AA.
26+
*/
27+
.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin::before {
28+
position: absolute;
29+
top: 50%;
30+
left: 50%;
31+
transform: translate(-50%, -50%);
1932
}

0 commit comments

Comments
 (0)