このバグは、circle および arc メソッドのコメントに記載されています。draw.circle documentationのコメントに 1 つの回避策があります。これは、その回避策から適応されています。
def draw_outlined_circle(surf, color, origin, radius, thickness):
width = radius * 2 + thickness * 2
background = (0, 0, 0, 0)
circle = pygame.Surface((width, width)).convert_alpha()
rect = circle.get_rect()
circle.fill(background)
pygame.draw.circle(circle, color, rect.center, radius)
pygame.draw.circle(circle, background, rect.center, radius - thickness)
surf.blit(circle, (origin[0] - (rect.w / 2), origin[1] - (rect.w / 2)))
この方法では、エクストラSurface
を使用して 2 つの円を描画します。大きな円の内側に小さな円を描いて、同じ効果を実現します。小さい円の塗りつぶしカラーのアルファは 0 であるため、完全な円の中心は透明に見えます。
編集: 上記のコメントから、動作が pygame FAQ にも記載されていることがわかります。