Skip to content

cupertino-files / MaskModel

Class: MaskModel ​

Defined in: src/tsd/masks.ts:95

A mask drawable, wrapping the geometry that defines the crop window.

Extends ​

Constructors ​

Constructor ​

new MaskModel(store, object): MaskModel

Defined in: src/tsd/drawables.ts:94

Parameters ​

store ​

ObjectStore

object ​

IwaObject

Returns ​

MaskModel

Inherited from ​

DrawableModel.constructor

Properties ​

object ​

readonly object: IwaObject

Defined in: src/tsd/drawables.ts:92

Inherited from ​

DrawableModel.object


store ​

readonly store: ObjectStore

Defined in: src/tsd/drawables.ts:91

Inherited from ​

DrawableModel.store

Accessors ​

accessibilityDescription ​

Get Signature ​

get accessibilityDescription(): string | undefined

Defined in: src/tsd/drawables.ts:204

Returns ​

string | undefined

Set Signature ​

set accessibilityDescription(value): void

Defined in: src/tsd/drawables.ts:208

Parameters ​
value ​

string | undefined

Returns ​

void

Inherited from ​

DrawableModel.accessibilityDescription


hyperlinkUrl ​

Get Signature ​

get hyperlinkUrl(): string | undefined

Defined in: src/tsd/drawables.ts:200

Returns ​

string | undefined

Inherited from ​

DrawableModel.hyperlinkUrl


id ​

Get Signature ​

get id(): bigint

Defined in: src/tsd/drawables.ts:99

Returns ​

bigint

Inherited from ​

DrawableModel.id


isRectangular ​

Get Signature ​

get isRectangular(): boolean

Defined in: src/tsd/masks.ts:114

True when the path traces a rectangle in its own space.

Not "a rectangle the size of the frame": the path is stretched to naturalSize when drawn, so its own dimensions are arbitrary. The only shape any corpus file uses, and the only one setSize will touch — resizing an instant-alpha outline would distort the cut-out.

Returns ​

boolean


type ​

Get Signature ​

get type(): number

Defined in: src/tsd/drawables.ts:103

Returns ​

number

Inherited from ​

DrawableModel.type


typeName ​

Get Signature ​

get typeName(): string | undefined

Defined in: src/tsd/drawables.ts:107

Returns ​

string | undefined

Inherited from ​

DrawableModel.typeName

Methods ​

geometry() ​

geometry(): GeometryInfo | undefined

Defined in: src/tsd/drawables.ts:115

Returns ​

GeometryInfo | undefined

Inherited from ​

DrawableModel.geometry


naturalSize() ​

naturalSize(): { height: number; width: number; } | undefined

Defined in: src/tsd/masks.ts:136

The size the path is stretched to, which is what sizes the crop.

Returns ​

{ height: number; width: number; } | undefined


pathSize() ​

pathSize(): { height: number; width: number; } | undefined

Defined in: src/tsd/masks.ts:128

The rectangle the path traces, in the path's own coordinates.

Rarely interesting on its own — the drawn size is naturalSize — but it is what isRectangular tests, so it is worth being able to see.

Returns ​

{ height: number; width: number; } | undefined


pathSource() ​

pathSource(): RawMessage | undefined

Defined in: src/tsd/masks.ts:97

The mask's path source, if it has one.

Returns ​

RawMessage | undefined


setGeometry() ​

setGeometry(update): void

Defined in: src/tsd/drawables.ts:132

Move and/or resize. Only the provided components are changed.

Parameters ​

update ​
angle? ​

number

height? ​

number

width? ​

number

x? ​

number

y? ​

number

Returns ​

void

Inherited from ​

DrawableModel.setGeometry


setPathRectangle() ​

setPathRectangle(width, height): void

Defined in: src/tsd/drawables.ts:180

Rewrite a shape's rectangular path to a new size.

A shape's path renders scaled from the path source's naturalSize to the geometry frame, text and all: 93 of the corpus's 103 text-bearing Keynote boxes store a natural size that differs from their frame, and a text box resized by frame alone shrinks or clips its text against the donor's path — the measured field failure. Pages' own text boxes keep path and frame equal (97 of 97), so a text box resized through this library gets both: setGeometry for the frame, this for the text's coordinate space. Which of the two states Keynote's own resize writes is unmeasured, so the two calls stay explicit rather than one implying the other.

Throws when the shape has no bezier path source, or its path is not a plain axis-aligned rectangle — rewriting a star or an arrow into a box would flatten the shape.

Parameters ​

width ​

number

height ​

number

Returns ​

void

Inherited from ​

DrawableModel.setPathRectangle


setSize() ​

setSize(width, height): void

Defined in: src/tsd/masks.ts:151

Resize the crop window.

Changes the frame and naturalSize together — they are equal in every corpus file, and naturalSize is what the path is stretched to. The path itself is left alone: it already describes a rectangle, and its own dimensions do not reach the rendered result.

Parameters ​

width ​

number

height ​

number

Returns ​

void


style() ​

style(): DrawableStyleHandle | undefined

Defined in: src/tsd/drawables.ts:222

Visual style — fill, stroke, opacity, shadow, reflection.

This is where drawable shadows live. Cell and table styles have no shadow field at all, so a shadow on a table means a shadow on the shape or image, not on its cells.

Returns ​

DrawableStyleHandle | undefined

Inherited from ​

DrawableModel.style

MIT licensed. Independently made — not by Apple in California. Not affiliated with or endorsed by Apple Inc.