Grid
public struct Grid : Equatable
Represents a grid that can be drawn on a PDF page.
-
Creates a new grid.
Declaration
Parameters
sizeThe size of the grid.
linesThe parameters of the vertical and horizontal major and minor lines of the grid. Default value is
Lines.default.labelsThe parameters of the labels for vertocal and horizontal lines of the grid. If specified
nil, no labels will be drawn. Default value isnil.serifsThe parameters of the serifs for vertocal and horizontal lines of the grid. If specified
nil, no serifs will be drawn. Default value isSerifs.defalut. -
Creates a new grid.
Declaration
Parameters
widthThe width of the grid.
heightThe height of the grid.
linesThe parameters of the vertical and horizontal major and minor lines of the grid. Default value is
Lines.default.labelsThe parameters of the labels for vertocal and horizontal lines of the grid. If specified
nil, no labels will be drawn. Default value isnil.serifsThe parameters of the serifs for vertocal and horizontal lines of the grid. If specified
nil, no serifs will be drawn. Default value isSerifs.defalut.
-
The size of the grid.
Declaration
Swift
public var size: Size -
The parameters of the lines of the grid.
Declaration
Swift
public var lines: Lines -
The parameters of the labels of the grid.
Declaration
Swift
public var labels: Labels -
The parameters of the serifs of the grid.
Declaration
Swift
public var serifs: Serifs
-
Draws the grid in the provided context.
Declaration
Swift
public func draw(in context: DrawingContext, position: Point) throwsParameters
contextThe context to draw the grid in.
positionThe lower-left corner of the grid.
-
Represents the properties of a grid’s line labels. Labels can only be placed near serifs.
See moreDeclaration
Swift
public struct LabelParameters
-
Encapsulates the parameters of the labels for vertical and horizontal lines.
See moreDeclaration
Swift
public struct Labels : Equatable
-
Encapsulates the parameters of the vertical and horizontal major and minor lines.
See moreDeclaration
Swift
public struct Lines : Hashable
-
Represents the properties of a grid’s major lines.
See moreDeclaration
Swift
public struct MajorLineParameters : Hashable
-
Represents the properties of a grid’s minor lines.
See moreDeclaration
Swift
public struct MinorLineParameters : Hashable
-
Represents the properties of a grid’s serifs. Serifs are short lines that can be placed on the edges of a grid and serve to put labels near them.
See moreDeclaration
Swift
public struct SerifParameters : Hashable
View on GitHub
Grid Structure Reference