---
title: CGPathAddLineToPoint
framework: coregraphics
role: symbol
role_heading: Function
path: coregraphics/cgpathaddlinetopoint
---

# CGPathAddLineToPoint

Appends a line segment to a mutable graphics path.

## Declaration

```occ
extern void CGPathAddLineToPoint(CGMutablePathRef path, const CGAffineTransform *m, CGFloat x, CGFloat y);
```

## Parameters

- `path`: The mutable path to change. The path must not be empty.
- `m`: A pointer to an affine transformation matrix, or NULL if no transformation is needed. If specified, Core Graphics applies the transformation to the line before it is added to the path.
- `x`: The x-coordinate of the end point of the line.
- `y`: The y-coordinate of the end point of the line.

## Discussion

Discussion Before returning, this function updates the current point to the specified location (x,y).

## See Also

### Constructing a Graphics Path

- [CGPathMoveToPoint](coregraphics/cgpathmovetopoint.md)
- [CGPathAddLines](coregraphics/cgpathaddlines.md)
- [CGPathAddRect](coregraphics/cgpathaddrect.md)
- [CGPathAddRects](coregraphics/cgpathaddrects.md)
- [CGPathAddEllipseInRect](coregraphics/cgpathaddellipseinrect.md)
- [CGPathAddRoundedRect](coregraphics/cgpathaddroundedrect.md)
- [CGPathAddArc](coregraphics/cgpathaddarc.md)
- [CGPathAddArcToPoint](coregraphics/cgpathaddarctopoint.md)
- [CGPathAddRelativeArc](coregraphics/cgpathaddrelativearc.md)
- [CGPathAddCurveToPoint](coregraphics/cgpathaddcurvetopoint.md)
- [CGPathAddQuadCurveToPoint](coregraphics/cgpathaddquadcurvetopoint.md)
- [CGPathAddPath](coregraphics/cgpathaddpath.md)
- [closeSubpath()](coregraphics/cgmutablepath/closesubpath().md)
