Skip to content
Extensions

Snap guide policy ​

Loading interactive example…Open in new tab ↗
Opening the live canvas…

Choose Sides and centers, Sides only, or Centers only, then move a card beside the other. Sides use the left, right, top and bottom of resolved bounds; centers use their horizontal and vertical midpoints.

The candidate menu compares limits of 8 and 24 nearby shapes. Only the nearest visible shapes, up to the limit, are considered for alignment. A smaller limit does less work but may skip a useful alignment.

The visible viewport defines the candidate pool. Zooming out includes more world space and potentially more candidates; panning changes the pool. The snap tolerance stays at 6 screen pixels as you zoom. The candidate cap defaults to 24; the API accepts 1–256. Policy changes go through controller.edits.setOptions(options.copyWith(...)), preserve the other SnapGuidesOptions fields and do not enter document undo history.

See Snap guides, grid snapping, and snap guide options.

Guide appearance is part of the extension's options: SnapGuidesExtension(theme: SnapGuideTheme(color: Color(0xFF5260FF))). You can supply any Flutter color; without a theme the guides use SnapGuideTheme.light or SnapGuideTheme.dark by the canvas DiagramTheme.brightness.