Contents

centerScanRect(_:)

Converts the corners of a specified rectangle to lie on the center of device pixels, which is useful in compensating for rendering overscanning when the coordinate system has been scaled.

Declaration

func centerScanRect(_ rect: NSRect) -> NSRect

Parameters

  • rect:

    The rectangle whose corners are to be converted.

Return Value

The adjusted rectangle.

Discussion

This method converts the given rectangle to device coordinates, adjusts the rectangle to lie in the center of the pixels, and converts the resulting rectangle back to the view’s coordinate system. Note that this method does not take into account any transformations performed using the NSAffineTransform class or Quartz 2D routines.

See Also

Related Documentation

Converting Coordinate Values