def rect(position, width, height, roundness): """Create a rectangle or rounded rectangle.""" p = Path() if roundness == Point.ZERO: p.rect(position.x, position.y, width, height) else: p.roundedRect(position.x, position.y, width, height, roundness.x, roundness.y) return p