Edit in GitHubLog an issue

@add-on-hlapi-sdk / RectangleNode

Class: RectangleNode

A RectangleNode represents a rectangle object in the scenegraph.

Hierarchy

Implements

Table of contents

Properties

Accessors

Methods

Properties

DEFAULT_STROKE_WIDTH

Static DEFAULT_STROKE_WIDTH: number = 20

Inherited from

FillableNode.DEFAULT_STROKE_WIDTH

Accessors

absoluteRotation

get absoluteRotation(): number

The node's absolute (global) rotation angle in degrees – includes any cumulative rotation from the node's parent containers.

Returns

number

Inherited from

FillableNode.absoluteRotation

set absoluteRotation(value): void

Parameters

NameType
value
number

Returns

void

Inherited from

FillableNode.absoluteRotation


absoluteTransform

get absoluteTransform(): mat2d

The node's absolute (global) transform matrix.

Returns

mat2d

Inherited from

FillableNode.absoluteTransform


allChildren

get allChildren(): Readonly<Iterable<Node>>

Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or GroupNode also provide a mutable children list. Other nodes with a more specific structure can hold children in various discrete "slots"; this allChildren list includes all such children and reflects their overall display z-order.

Returns

Readonly<Iterable<Node>>

Inherited from

FillableNode.allChildren


blendMode

get blendMode(): BlendModeValue

Blend mode determines how a node is composited onto the content below it. The default value is normal for most nodes, and passThrough for GroupNodes.

Returns

BlendModeValue

Inherited from

FillableNode.blendMode

set blendMode(value): void

Parameters

NameType
value

Returns

void

Inherited from

FillableNode.blendMode


bottomLeftRadius

get bottomLeftRadius(): number

The radius of the bottom left corner, or 0 if the corner is not rounded.

Remarks

The actual corner radius that is rendered is capped based on the size of the rectangle even if the radius value set here is higher.

Returns

number

set bottomLeftRadius(value): void

Parameters

NameType
value
number

Returns

void


bottomRightRadius

get bottomRightRadius(): number

The radius of the bottom right corner, or 0 if the corner is not rounded.

Remarks

The actual corner radius that is rendered is capped based on the size of the rectangle even if the radius value set here is higher.

Returns

number

set bottomRightRadius(value): void

Parameters

NameType
value
number

Returns

void


fills

get fills(): ItemList<Fill>

Any fill(s) on the shape. Use the methods on this ItemList object to get, add, and remove fills.

Returns

ItemList<Fill>

Inherited from

FillableNode.fills


height

get height(): number

The height of the node. Must be at least MIN_DIMENSION.

Returns

number

Implementation of

IRectangularNode.height

set height(value): void

Parameters

NameType
value
number

Returns

void

Implementation of

IRectangularNode.height


locked

get locked(): boolean

The node's lock/unlock state. Locked nodes are excluded from the selection (see selection), and cannot be edited by the user unless they are unlocked first.

Returns

boolean

Inherited from

FillableNode.locked

set locked(locked): void

Parameters

NameType
locked
boolean

Returns

void

Inherited from

FillableNode.locked


opacity

get opacity(): number

The node's opacity, from 0.0 to 1.0

Returns

number

Inherited from

FillableNode.opacity

set opacity(opacity): void

Parameters

NameType
opacity
number

Returns

void

Inherited from

FillableNode.opacity


parent

get parent(): undefined | Node

The node's parent. Undefined if the node is an orphan, or if the node is the artwork root.

Returns

undefined | Node

Inherited from

FillableNode.parent


relativeRotation

get relativeRotation(): number

The node's local rotation value in degrees, relative to its parent's axes. Modifying this value will also adjust the node's x & y translation such that the node's center is in the same location after the rotation – i.e. this setter rotates the node about its bounding box's center, not its origin.

Returns

number

Inherited from

FillableNode.relativeRotation

set relativeRotation(value): void

Parameters

NameType
value
number

Returns

void

Inherited from

FillableNode.relativeRotation


relativeTransform

get relativeTransform(): mat2d

The node's transform matrix relative to its parent.

Returns

mat2d

Inherited from

FillableNode.relativeTransform


strokes

get strokes(): ItemList<Stroke>

Any stroke(s) on the shape. Use the methods on this ItemList object to get, add, and remove strokes.

Returns

ItemList<Stroke>

Inherited from

FillableNode.strokes


topLeftRadius

get topLeftRadius(): number

The radius of the top left corner, or 0 if the corner is not rounded.

Remarks

The actual corner radius that is rendered is capped based on the size of the rectangle even if the radius value set here is higher.

Returns

number

set topLeftRadius(value): void

Parameters

NameType
value
number

Returns

void


topRightRadius

get topRightRadius(): number

The radius of the top right corner, or 0 if the corner is not rounded.

Remarks

The actual corner radius that is rendered is capped based on the size of the rectangle even if the radius value set here is higher.

Returns

number

set topRightRadius(value): void

Parameters

NameType
value
number

Returns

void


translateX

get translateX(): number

The translation of the node along its parent's x-axis.

Returns

number

Inherited from

FillableNode.translateX

set translateX(value): void

Parameters

NameType
value
number

Returns

void

Inherited from

FillableNode.translateX


translateY

get translateY(): number

The translation of the node along its parent's y-axis.

Returns

number

Inherited from

FillableNode.translateY

set translateY(value): void

Parameters

NameType
value
number

Returns

void

Inherited from

FillableNode.translateY


type

get type(): SceneNodeTypeValueID

The node's type.

Returns

SceneNodeTypeValueID

Inherited from

FillableNode.type


width

get width(): number

The width of the node. Must be at least MIN_DIMENSION.

Returns

number

Implementation of

IRectangularNode.width

set width(value): void

Parameters

NameType
value
number

Returns

void

Implementation of

IRectangularNode.width

Methods

getUniformCornerRadius

getUniformCornerRadius(): undefined | number

If all corners have the same rounding radius value, returns that value (or 0 if all corners are not rounded). If the corner radii differ, returns undefined.

Returns

undefined | number


removeFromParent

removeFromParent(): void

Removes the node from its parent - for a basic ContainerNode, this is equivalent to node.parent.children.remove(node). For nodes with other slots, removes the child from whichever slot it resides in, if possible. Throws if the slot does not support removal. Also throws if node is the artwork root. No-op if node is already an orphan.

Returns

void

Inherited from

FillableNode.removeFromParent


setUniformCornerRadius

setUniformCornerRadius(radius): void

Set all corner radii to the same value. Set to 0 to make the corners non-rounded.

Remarks

The actual corner radius that is rendered is capped based on the size of the rectangle even if the radius value set here is higher.

Parameters

NameType
radius
number

Returns

void

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.