rulerView(_:willAdd:atLocation:)
Returns a potentially modified location to which the marker should be added.
Declaration
func rulerView(_ ruler: NSRulerView, willAdd marker: NSRulerMarker, atLocation location: CGFloat) -> CGFloatParameters
- ruler:
The ruler view sending the message.
- marker:
The marker to be added.
- location:
The new location for the marker, in the ruler view’s coordinates.
Return Value
The modified location to which the marker should be added.
Discussion
This method ensures that the proposed location of aMarker lies within the appropriate bounds for the receiver’s text container, returning the modified location. Appropriate bounds are those of the text container minus its line fragment padding.
Typically, the ruler view’s width matches that of its text view.