docs: def _get_port_center_position(self, width):
          """Calculates the center position of the port rectangle
  
          The port itself can be positioned in the corner, the center of the port rectangle however is restricted by
          the width of the rectangle. This method therefore calculates the center, depending on the position of the
          port and the width of the rectangle.
          :param float width: The width of the rectangle
          :return: The center position of the rectangle
          :rtype: float, float
          """
          x, y = self.pos.x.value, self.pos.y.value
          if self.side is SnappedSide.TOP or self.side is SnappedSide.BOTTOM:
              if x - width / 2. < 0:
                  x = width / 2
              elif x + width / 2. > self.parent.width:
                  x = self.parent.width - width / 2.
          else:
              if y - width / 2. < 0:
                  y = width / 2
              elif y + width / 2. > self.parent.height:
                  y = self.parent.height - width / 2.
          return x, y