Modify — closed-shape editing tools
The Modify group on the toolbar (between Transform and History) holds three AutoCAD-style editing tools. All three preserve the closed-polygon invariant — they never produce open line-art that would fail GDS export.
Stretch
Shortcut: S — also findable in the command palette (Ctrl+K) by its own name or KLayout's term, "partial move".
The Stretch tool has two pickup styles, chosen by what's under the cursor when you click:
- Click on an edge → direct edge-drag. The edge slides perpendicular to its own direction. Cursor motion along the edge is discarded so the edge stays parallel to itself; the two adjacent edges shear automatically to keep the polygon closed. A solid-amber rubber-band marks the edge while you drag, and the hovered edge is highlighted in amber even before you click.
- Click on empty space → marquee a crossing-window rectangle. Every vertex inside the window is marked when you release; marked vertices are painted as amber dots. Click any marked vertex (or anywhere in the canvas) and drag to translate the entire group together — vertices outside the window stay anchored.
For the marquee/crossing-window translate, Ortho (F8) and Polar tracking (F10) apply just like drawing a Polygon or Path — Shift inverts ortho temporarily. Under ortho the drag keeps the start point's coordinate on the locked axis exactly, and only the free axis follows the grid; at 45° it steps along the diagonal in whole grid steps. Object snap applies too, from the point where you pressed: a vertex, crossing, midpoint, circle centre or perpendicular foot within 8 px of the pointer is where the drag ends, and the same marker shows its kind. Under ortho only a target on the locked axis counts; any other is ignored. The shapes you are stretching are never targets.
Direct edge-drag deliberately ignores ortho/polar because motion is already 1D (perpendicular to the picked edge). It does take object snap: move near a vertex, crossing, midpoint or centre of another shape and the edge's line lands exactly on it, with the marker; the shape you are dragging is never a target.
Snap-to-grid is honoured in both styles when no object snap applies. Esc cancels.
Undo restores the pre-drag geometry in one step regardless of how many vertices moved.
Match Properties (paintbrush)
Pick a source shape with the first click; every subsequent click applies the source's matchable fields to the clicked target:
- Boundary target ← layer + datatype only.
- Path target ← layer + datatype + width + path-end style (+ the absolute-width flag, explicitly cleared if the source is relative).
- Text target ← layer + datatype + text size + letter spacing + orientation (angle/mirror) — explicitly straightened even if the source itself was upright.
Fields that don't apply to the target's kind are silently skipped (so picking a path as the source and clicking a boundary won't try to copy width). Esc drops the current source (a second Esc clears the selection); the tool stays Match Properties until you pick another tool.
Slice
Two clicks define a cut line; every selected closed boundary is partitioned into the two halves on either side of the line. The slice line respects snap-to-grid — both endpoints land on grid intersections when snap is on, and the dashed preview shows exactly where the cut will happen.
You must select at least one boundary first — slicing every shape in the active cell when the user clicks blindly was too dangerous to be the default. The originals are replaced by their halves in one replaceShapes command, so a single Undo restores the pre-slice shape.