API Collection
GSLayer Selection
Access and modify the elements selected in a layer.
Overview
A selection is an ordered set of selectable elements. Selecting nodes does not select their path, and a selection can contain different kinds of elements.
Most selection mutation methods notify observers but do not register undo. Use the methods that include Undo when the selection change must be undoable.
Topics
Selection
The selected elements in selection order.
The number of selected elements.
Replaces the selection and registers the previous selection for undo.
Adds an element to the selection if it is not already selected.
Adds elements to the selection, preserving their order.
Replaces the selection without registering undo.
Removes the selected element at an index.
Removes an element from the selection.
Removes elements from the selection.
Clears the selection without registering undo.
Clears the selection and registers the previous selection for undo.
Whether an element is selected.
Selection Serialization
Content representing the selected elements for serialization and paste.
Structural mappings for the selected elements.
Removes elements described by structural mappings.
Removes a selectable element from the layer.
Removes mapped nodes while preserving the unselected path portions.
Adds content from a serialized selection dictionary.
Separates paths by whether they contain selected nodes.
See Also
The different roles that a layer can serve.
The paths and components that form the outline of a layer.
Bounding rectangles of outlines, selections, and metrics.
Side bearings, baseline offsets, layer box, and metrics keys.
Setting for rounding coordinates on a layer.
Background content and reference images associated with a layer.
Named attachment points on a layer.
Manual and generated hint data on a layer.
Layer-local guides used while editing outlines.
Spacing adjustment between specific layers.
Layer-local notes displayed with a glyph.
Axis coordinates and rules that place layers in a design space.
Colors used to draw a layer.
Additional values stored for a layer.
Intersections between layer outlines and line segments.