napkin-sketchdocs 1.0.0 GitHub

Vector paths and stroke profiles#

On this page

At a glance#

Editing a vector path#

Editing a vector path: strokes drawn by the Vector Path, Curve, and quick-curve tools keep their anchor points and Bézier control handles (a cubic segment is B(t) = (1-t)³P0 + 3(1-t)²tP1 + 3(1-t)t²P2 + t³P3, where P0/P3 are anchors and P1/P2 the control points). With the Vector Path tool active and no path in progress, click such a stroke to open it for editing — every anchor shows, Illustrator-style. Then:

Direct Select#

Direct Select tool (A): shows the white arrow pointer — the selection / direct-selection pairing of vector editors. Click an element to show its anchor points, then drag an anchor to reshape the path. A stroke drawn by the Vector Path, Curve, or quick-curve tools shows just its few Bézier anchors (a quick curve is two), and the selected anchor's curvature handles — drag a handle to bend the curve, with the opposite handle staying collinear so the bend is smooth. A freehand stroke drawn since 1.0.0-alpha.4.6.0 is fitted with a few Bézier anchors when it is lifted (see Tools), so it shows those and edits like a curve; the Vector Path tool can edit it too. Older freehand strokes, two-point lines and shapes show their sampled points as before. Hold Space and drag to pan the canvas, exactly as with the Select tool, and the other quick keys (quick zoom, width, opacity, colors) work here too. Shift-click selects multiple anchors to move together; click the path (not an anchor) to select and move the whole path. A single selected anchor grows two tangent handles — hollow circles on guide lines reaching out along the path each way, like a vector editor's direction handles. Drag a handle to bend the stroke around the anchor: the anchor stays pinned, the span between anchor and handle turns rigidly so the handle tracks the pointer exactly, and the bend fades smoothly into the rest of the stroke beyond it. Pulling a handle longer or shorter stretches that span too. Selected anchors and paths render blue, and Esc drops the edit (Ctrl+Z restores the shape).

Select with a box#

Drag over empty canvas with Direct Select and a box follows the pointer. What it picks when it is let go depends on what it holds, across every path it reaches:

A press on empty canvas that does not travel is still a click there, and drops the edit. Shift adds what the box picks to what is already picked. The box leaves text out: a text's frame or path is edited by clicking its anchors.

Move a selection#

Drag a picked anchor or segment to move everything picked, on every path at once: a segment carries the anchors at both of its ends, their handles riding along, and a rectangle's seam moves as one corner. With no button down the arrow keys move the picks too - one step a press, ten with Shift - in the units the position fields show, so 1 and 10 pixels unless they are set otherwise. A step is a distance on the page, whatever the zoom. A drag is one undo step and so is each press of an arrow key; holding a key down repeats within that one step. With the whole path picked, the arrow keys move it.

Delete anchor points and segments#

With anchors or segments picked, Delete or Backspace - or Delete in the Edit menu or the canvas menu - takes them out of the path, and the rest stays:

A rectangle with its top-right corner deleted becomes an open L, its other three corners joined by the two sides that did not touch the deleted one:

o-------o                o
|       |       ->       |
|       |                |
o-------o                o-------o

It is one undo step, however many paths the picks were on. With only the path picked and no anchor or segment, Delete takes the whole path, as it always has. A text's frame or path keeps its points: Delete changes nothing there and says so. Removing an anchor in the Vector Path tool's edit mode is different: it takes out the point and joins its neighbours, so a closed path stays closed.

Sharpen Selection#

Sharpen Selection (toolbar button): smooths and simplifies the selected strokes, like a vector editor's simplify command. A small dialog opens in the corner with Smooth and Simplify sliders and the strokes preview the result live on the canvas as the sliders move; Apply keeps the new shape (one undo step returns the originals) and Cancel or Esc restores them untouched. Distinct from Sharpen all (H), which runs the hand-drawn auto-sharpen engine over every stroke.

Stroke Profiles#

Stroke Profile (the control above the Width slider, or Sketch > Stroke Profile): sets how a stroke's width runs along its length, as a width profile does in Illustrator. The control shows a picture of the current profile, and clicking it opens the Stroke Profile picker beneath it.