def METHOD_NAME(self, event):
    self._alignmentPaths = []
    painter = QPainter(self)
    painter.setPen(self._color)
    circleRadius = 2.5
    selectedRadius = 3
    padding = 1
    rect = event.rect()
    size = min(rect.height(), rect.width())
    offset = round(0.5 * (rect.width() - size))
    painter.translate(offset, 0)
    borderRect = rect.__class__(
        int(rect.left() + circleRadius + padding),
        int(rect.top() + circleRadius + padding),
        int(size - 2 * (circleRadius + padding)),
        int(size - 2 * (circleRadius + padding)),
    )
    borderPath = QPainterPath()
    borderPath.addRect(*borderRect.getRect())
    columnCount = 3
    radioPath = QPainterPath()
    selectedPath = QPainterPath()
    for row in range(columnCount):
        for col in range(columnCount):
            index = row * columnCount + col
            x, y = (
                padding + col * 0.5 * borderRect.width(),
                padding + row * 0.5 * borderRect.height(),
            )
            delta = selectedRadius - circleRadius
            sx = x - delta
            sy = y - delta
            if self._alignment == index:
                path = QPainterPath()
                path.addEllipse(sx, sy, 2 * selectedRadius, 2 * selectedRadius)
                selectedPath = path
            else:
                path = QPainterPath()
                path.addEllipse(x, y, 2 * circleRadius, 2 * circleRadius)
                radioPath.addPath(path)
            self._alignmentPaths.append(
                QRectF(sx + offset, sy, 2 * selectedRadius, 2 * selectedRadius)
            )
    painter.drawPath(borderPath - radioPath)
    painter.setRenderHint(QPainter.Antialiasing)
    painter.fillPath(radioPath, self._color)
    painter.fillPath(selectedPath, self._selectedColor)