Fix pixelated circle badges with a seam through the center

icon_circle_box's perfectly-circular StyleBoxFlat (corner radius equal
to half the box size, no straight edges between corners) is a known
Godot degenerate case that draws a faint seam through the middle when
antialiasing is on and looks faceted at low corner_detail. Bumping
corner_detail and disabling antialiasing renders a clean circle at
these small badge/icon sizes instead - affects every icon_circle_box
call site (answer badges, stat tiles, avatars, etc.), not just the
question player.
This commit is contained in:
hz
2026-07-22 23:48:00 -05:00
parent 6c388dfa5e
commit aef287ac26
+6
View File
@@ -146,6 +146,12 @@ static func icon_circle_box(dark: bool, accent: Color, radius: int, filled: bool
box.border_color = Color(accent, 0.48 if dark else 0.18)
box.set_border_width_all(1)
box.set_corner_radius_all(radius)
# A perfectly circular StyleBoxFlat (radius == half the box size, no straight edges
# between corners) is a known Godot degenerate case that can draw a faint seam through
# the middle when antialiasing is on; more corner segments plus disabling AA renders a
# clean circle instead at these small badge sizes.
box.corner_detail = 20
box.anti_aliasing = false
return box