Inherits from GSToolPlugin : NSResponder
Conforms to GlyphsToolDraw
GlyphsToolEvent
NSMenuDelegate
NSTextViewDelegate

Overview

A base class for all path editing tools. It handles drawing and basic path interaction

Subclass it for custom tool plugins

Properties

draggStart

Origin of the current dragging operation

@property (nonatomic) NSPoint draggStart

dragging

Yes if in a dragging state

@property (nonatomic) BOOL dragging

interfaceScale

The scaling factor for interface elements.

@property (nonatomic, readonly) CGFloat interfaceScale

Discussion

On Retina displays its 1.75, otherwise 1.0

toolBarIcon

The icon displayed in the toolbar.

@property (nonatomic, readonly) NSImage *toolBarIcon

Instance Methods

drawBegin:isSelected:atPoint:

Draws the starting node of an open path

- (void)drawBegin:(GSNode *)node isSelected:(BOOL)sel atPoint:(NSPoint)Point

Parameters

node

the start or end node

sel

If the node is selected or not

Point

The origin point of the current layer

drawHandle:atIndex:isSelected:atPoint:

Draws a node

- (void)drawHandle:(GSPath *)Path atIndex:(NSUInteger)Index isSelected:(BOOL)selected atPoint:(NSPoint)Point

Parameters

Path

The path that contains the node

Index

The index of the node

selected

If the node is selected or not

Point

The origin point of the current layer

getHandleRect:isSelected:atPoint:

The rect that for drawing the node

- (NSRect)getHandleRect:(NSPoint)pt isSelected:(bool)selected atPoint:(NSPoint)Point

Parameters

pt

the node postion

selected

If the node is selected or not

Point

The origin point of the current layer

Return Value

the rect

insertNewline:

Is called when the return key is pressed.

- (void)insertNewline:(id)sender

Parameters

sender

Typically the object that invoked this method.

Discussion

Overwrite for your own behavior.

Warning: Never call that yourself.