Inherits from NSObject
Conforms to NSCoding
NSCopying

Overview

GSElement: The base class for Layer elements.

The base class for Layer elements.

Properties

elementDict

Returns/sets the content of the element to store in pList.

@property (unsafe_unretained, nonatomic, nullable) NSDictionary *elementDict

parent

A Pointer to the containing object

@property (weak, nonatomic, nullable) id parent

position

The position of the element.

@property (assign, nonatomic) NSPoint position

positionPrecise

The unrounded position of the element.

@property (nonatomic, readonly) NSPoint positionPrecise

Discussion

This is used for consecutiv operations to avoid rounding errors

Instance Methods

initWithElementDict:

initialises a element with a dictionary loaded from a pList.

- (instancetype)initWithElementDict:(NSDictionary *)ElementDict

Parameters

ElementDict

A dictionary

setPositionFast:

Sets the position without notifying the path and no undo.

- (void)setPositionFast:(NSPoint)position

Parameters

position

The new position

Discussion

This is mostly used to build a new element list that is later added to the layer. Otherwise you need to make sure to anounce the changes. e.g. by calling [GSLayer elementDidChange:].