API > @blocksuite/blocks > Rect
Class: Rect ​
Constructors ​
constructor ​
new Rect(
left
,top
,right
,bottom
):Rect
Parameters ​
Parameter | Type |
---|---|
left | number |
top | number |
right | number |
bottom | number |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:94
Properties ​
max ​
max:
Point
Defined In ​
packages/blocks/src/_common/utils/rect.ts:92
min ​
min:
Point
Defined In ​
packages/blocks/src/_common/utils/rect.ts:90
Accessors ​
bottom ​
get
bottom():number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:141
packages/blocks/src/_common/utils/rect.ts:145
height ​
get
height():number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:109
packages/blocks/src/_common/utils/rect.ts:113
left ​
get
left():number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:117
packages/blocks/src/_common/utils/rect.ts:121
right ​
get
right():number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:133
packages/blocks/src/_common/utils/rect.ts:137
top ​
get
top():number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:125
packages/blocks/src/_common/utils/rect.ts:129
width ​
get
width():number
Defined In ​
packages/blocks/src/_common/utils/rect.ts:101
packages/blocks/src/_common/utils/rect.ts:105
Methods ​
center ​
center():
Point
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:149
clamp ​
clamp(
p
):Point
Parameters ​
Parameter | Type |
---|---|
p | Point |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:217
clone ​
clone():
Rect
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:221
contains ​
contains(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Rect |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:175
equals ​
equals(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Rect |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:171
extend_with ​
extend_with(
point
):void
Parameters ​
Parameter | Type |
---|---|
point | Point |
Returns ​
void
Defined In ​
packages/blocks/src/_common/utils/rect.ts:156
extend_with_x ​
extend_with_x(
x
):void
Parameters ​
Parameter | Type |
---|---|
x | number |
Returns ​
void
Defined In ​
packages/blocks/src/_common/utils/rect.ts:161
extend_with_y ​
extend_with_y(
y
):void
Parameters ​
Parameter | Type |
---|---|
y | number |
Returns ​
void
Defined In ​
packages/blocks/src/_common/utils/rect.ts:166
intersect ​
intersect(
other
):Rect
Parameters ​
Parameter | Type |
---|---|
other | Rect |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:210
intersects ​
intersects(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Rect |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:179
isPointDown ​
isPointDown(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Point |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:194
isPointIn ​
isPointIn(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Point |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:188
isPointLeft ​
isPointLeft(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Point |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:202
isPointRight ​
isPointRight(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Point |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:206
isPointUp ​
isPointUp(
__namedParameters
):boolean
Parameters ​
Parameter | Type |
---|---|
__namedParameters | Point |
Returns ​
boolean
Defined In ​
packages/blocks/src/_common/utils/rect.ts:198
toDOMRect ​
toDOMRect():
DOMRect
Returns ​
DOMRect
Defined In ​
packages/blocks/src/_common/utils/rect.ts:226
fromDOM ​
static
fromDOM(dom
):Rect
Parameters ​
Parameter | Type |
---|---|
dom | Element |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:259
fromDOMRect ​
static
fromDOMRect(__namedParameters
):Rect
Parameters ​
Parameter | Type |
---|---|
__namedParameters | DOMRect |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:255
fromLTRB ​
static
fromLTRB(left
,top
,right
,bottom
):Rect
Parameters ​
Parameter | Type |
---|---|
left | number |
top | number |
right | number |
bottom | number |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:231
fromLWTH ​
static
fromLWTH(left
,width
,top
,height
):Rect
Parameters ​
Parameter | Type |
---|---|
left | number |
width | number |
top | number |
height | number |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:235
fromPoint ​
static
fromPoint(point
):Rect
Parameters ​
Parameter | Type |
---|---|
point | Point |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:243
fromPoints ​
static
fromPoints(start
,end
):Rect
Parameters ​
Parameter | Type |
---|---|
start | Point |
end | Point |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:247
fromXY ​
static
fromXY(x
,y
):Rect
Parameters ​
Parameter | Type |
---|---|
x | number |
y | number |
Returns ​
Defined In ​
packages/blocks/src/_common/utils/rect.ts:239