Grid
public struct Grid : Equatable
Represents a grid that can be drawn on a PDF page.
-
Creates a new grid.
Declaration
Parameters
size
The size of the grid.
lines
The parameters of the vertical and horizontal major and minor lines of the grid. Default value is
Lines.default
.labels
The parameters of the labels for vertocal and horizontal lines of the grid. If specified
nil
, no labels will be drawn. Default value isnil
.serifs
The 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
width
The width of the grid.
height
The height of the grid.
lines
The parameters of the vertical and horizontal major and minor lines of the grid. Default value is
Lines.default
.labels
The parameters of the labels for vertocal and horizontal lines of the grid. If specified
nil
, no labels will be drawn. Default value isnil
.serifs
The 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) throws
Parameters
context
The context to draw the grid in.
position
The 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