Instance Method

backingAlignedRect(_:options:)

Returns a backing store pixel aligned rectangle in window coordinates.

Declaration

func backingAlignedRect(_ rect: NSRect, options: AlignmentOptions = []) -> NSRect

Parameters

rect

The rectangle in view coordinates.

options

The alignment options. See AlignmentOptions for possible values.

Return Value

A rectangle that is aligned to the backing store pixels using the specified options. The rectangle is in window coordinates.

Discussion

Uses the NSIntegralRectWithOptions(_:_:) function to produce a backing store pixel aligned rectangle from the given input rectangle in window coordinates.

See Also

Converting Coordinates

var backingScaleFactor: CGFloat

The backing scale factor.

func convertFromBacking(NSRect) -> NSRect

Converts a rect from its pixel aligned backing store coordinate system to the window’s coordinate system.

func convertToBacking(NSRect) -> NSRect

Converts a rectangle from the window’s coordinate system to its pixel aligned backing store coordinate system.

func convertToScreen(NSRect) -> NSRect

Converts the rectangle to the screen coordinate system from the window’s coordinate system.

func convertFromScreen(NSRect) -> NSRect

Converts the rectangle from the screen coordinate system to the window’s coordinate system