Whenever you draw a new shape or edit an existing one, you are essentially interacting with the points directly, and the lines that Sketch draws between those points are what you see on screen. Sometimes the lines between the points are straight lines (a line) and at other times they are bent (a curve).
Insert a rectangle from the toolbar by going to Insert › Shape › Rectangle. Draw it on the canvas and when done, double-click it to start editing:
You will see a round point in each of the corners. You can click on these points and drag them around to change their position. You will see that the rest of the shape changes accordingly. You can click anywhere on a line between two points to insert a point on there which you can then move around independently as well. To delete a point, click on it and press backspace/return on your keyboard:
If you want curved lines instead of straight ones, you can double-click a point. You will see two little handles appear on either side of the point. They control the curvature of the line on either side. Think of these little control points as if they are pulling the line towards themselves.
For an in-depth article about how control points work in Sketch, check Peter Nowell’s excellent Mastering the Bézier Curve in Sketch.
There are different ways in which the points limit the movement of their little control points and, in turn, the kind of lines that are produced between them.
While editing a shape you will see that the inspector shows you four different modes for the point; Straight, Mirrored, Disconnected and Asymmetric.
- Straight: If you apply the first mode on your shape you’ll get no little control points and basically a straight line.
- Mirrored: Control points mirror each other; they are opposite each other and at the same distance from the main - point. If a vector point is not straight, this is the default.
- Asymmetric: Distance between the control points and the main point is independent, but they do mirror each other.
- Disconnected: Control points are completely independent of each other.
If a point is set to Straight, you can use the slider under this section to turn the straight corner into a rounded one. If you go to Insert › Shape › Rounded Rectangle you’ll get a basic rectangle with four points where the corner roundness has already been set for you.
Being able to control corner roundness on a per-point basis allows you to have different radii per corner; you can just round the top two corners and keep the bottom two sharp, for example:
Keyboard Shortcuts: you can use the number keys 1 to 4 to change the selected point’s type. Hit 1 for Straight, 2 for Mirrored, 3 for Disconnected and 4 for Asymmetric.
Drawing versus Editing
Instead of starting with a predefined shape, you can also draw a shape from scratch by using the Vector Tool. Click Insert › Vector from the toolbar and click anywhere on the canvas to add your first point. Click somewhere else to add the second.
You will see that a line now connects both. Now click somewhere but hold down the mouse while you drag away to draw a curve. You can draw a few more lines like that and when you click again on the first line you’ll close shape and finish editing.
Selecting other points, inserting points on lines, and anything else is exactly the same, whether you’re editing an existing shape or drawing a new one.
Closed vs Open
A path can be either closed or open. When it is closed, the last line in the path connects back to the first. When a path is open, it leaves a gap between the last point and the first. You can turn a closed path to an open one and vice versa by going to Layer › Paths › Close Path in the menu.
Whenever you are in shape-editing mode you can add new points to a path as long as the shape is open.
Note that whenever you’ve applied a fill-style to your shape, the fill will draw as if the path was closed - even if the border is drawn with a gap.
If you hold down ⇧ before inserting in a new point at the end of a vector it will instead align it at 45º angles to the previous point, ideal for drawing straight lines.
If you hold down the ⌘ key and click on a line between two points, Sketch will insert the point exactly in the middle of the line for you.
Something that not be immediately obvious is that you can select multiple points and move them all at once. To select multiple points, hold down ⇧ while you click on points. You’ll see that the selected point has a white centre while deselected ones are grey.
Another way to select multiple points is to hold down ⇧ and then click and drag from an empty area in the view to make a rectangular selection. If you are still holding down ⇧ when you let go it will extend the selection you had before dragging with the newly selected points. If not, it will deselect the old points and just select the newly selected points.