cpr.geometry.Insets

A geometric operation object that abstracts the top, bottom, left, and right margins.

Index

Properties
Name Type Description
bottom Number Default 0 below
height Number We get the sum of the top and bottom margins.
left Number Left default 0
right Number Right default 0
top Number Above default 0
width Number The sum of the left and right margins is obtained.
Methods
Name Return Type Description
add Insets Add a margin.
getAdded Insets Get a copy object with different margins added.
getCopy Insets Get a copy object.
getTransposed Insets You get a copy with the x and y axes reversed.
isEmpty Boolean Returns whether all margins are empty.
negate Insets Inverts all the top, bottom, left and right margins.
transpose Insets Invert the x-axis and y-axis.

Constructor

Insets(top, right, bottom, left)
Parameters
name type description
top Number Top margin
right Number Right margin
bottomoptional Number defaultundefined Bottom margin
leftoptional Number defaultundefined Left margin

Properties

bottom
type Number
Default 0 below
height
type Number
readonly
We get the sum of the top and bottom margins.
left
type Number
Left default 0
right
type Number
Right default 0
top
type Number
Above default 0
width
type Number
readonly
The sum of the left and right margins is obtained.

Methods

add(other)
Add a margin.
Parameters
name type description
other Insets Another margin object to add.
return Insets
getAdded(other)
Get a copy object with different margins added.
Parameters
name type description
other Insets Margin to add.
return Insets
getCopy()
Get a copy object.
return Insets
getTransposed()
You get a copy with the x and y axes reversed.
return Insets
isEmpty()
Returns whether all margins are empty.
return Boolean
negate()
Inverts all the top, bottom, left and right margins.
return Insets
transpose()
Invert the x-axis and y-axis.
return Insets