@univerjs/core v0.5.0-beta.1 • Docs
Class: Rectangle
This class provides a set of methods to calculate IRange
.
Constructors
new Rectangle()
new Rectangle(): Rectangle
Returns
Methods
clone()
static clone(src): IRange
Parameters
Parameter | Type |
---|---|
src | IRange |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:25
contains()
static contains(src, target): boolean
Parameters
Parameter | Type |
---|---|
src | IRange |
target | IRange |
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:193
equals()
static equals(src, target): boolean
Parameters
Parameter | Type |
---|---|
src | IRange |
target | IRange |
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:44
getIntersectionBetweenTwoRect()
static getIntersectionBetweenTwoRect(rect1, rect2): null | Required<IRectLTRB>
Parameters
Parameter | Type |
---|---|
rect1 | IRectLTRB |
rect2 | IRectLTRB |
Returns
null
| Required
<IRectLTRB
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:383
getIntersects()
static getIntersects(src, target): Nullable<IRange>
Parameters
Parameter | Type |
---|---|
src | IRange |
target | IRange |
Returns
Deprecated
use getIntersectRange
instead. This method does not handle NaN and does not return the correct rangeType
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:116
getPositionRange()
static getPositionRange(
relativeRange,
originRange,
absoluteRange?): IRange
Parameters
Parameter | Type |
---|---|
relativeRange | IRange |
originRange | IRange |
absoluteRange ? | IRange |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:247
getRelativeRange()
static getRelativeRange(range, originRange): IRange
Parameters
Parameter | Type |
---|---|
range | IRange |
originRange | IRange |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:239
hasIntersectionBetweenTwoRect()
static hasIntersectionBetweenTwoRect(rect1, rect2): boolean
Parameters
Parameter | Type |
---|---|
rect1 | IRectLTRB |
rect2 | IRectLTRB |
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:370
intersects()
static intersects(src, target): boolean
Parameters
Parameter | Type |
---|---|
src | IRange |
target | IRange |
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:76
mergeRanges()
static mergeRanges(ranges): IRange[]
Combine smaller rectangles into larger ones
Parameters
Parameter | Type |
---|---|
ranges | IRange [] |
Returns
IRange
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:349
moveHorizontal()
static moveHorizontal(
range,
step,
length): IRange
Parameters
Parameter | Type | Default value |
---|---|---|
range | IRange | undefined |
step | number | 0 |
length | number | 0 |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:257
moveOffset()
static moveOffset(
range,
offsetX,
offsetY): IRange
Parameters
Parameter | Type |
---|---|
range | IRange |
offsetX | number |
offsetY | number |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:269
moveVertical()
static moveVertical(
range,
step,
length): IRange
Parameters
Parameter | Type | Default value |
---|---|---|
range | IRange | undefined |
step | number | 0 |
length | number | 0 |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:263
realContain()
static realContain(src, target): boolean
Parameters
Parameter | Type |
---|---|
src | IRange |
target | IRange |
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:202
realUnion()
static realUnion(...ranges): IRange
Parameters
Parameter | Type |
---|---|
…ranges | IRange [] |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:226
simpleRangesIntersect()
static simpleRangesIntersect(rangeA, rangeB): boolean
Check intersects of normal range(RANGE_TYPE.NORMAL) For other types of ranges, please consider using the intersects method.
Parameters
Parameter | Type |
---|---|
rangeA | IRange |
rangeB | IRange |
Returns
boolean
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:66
sort()
static sort(ranges): IRange[]
Parameters
Parameter | Type |
---|---|
ranges | IRange [] |
Returns
IRange
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:406
splitIntoGrid()
static splitIntoGrid(ranges): IRange[]
Parameters
Parameter | Type |
---|---|
ranges | IRange [] |
Returns
IRange
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:353
subtract()
static subtract(range1, range2): IRange[]
Subtract range2 from range1, the result is is horizontal first then vertical
Parameters
Parameter | Type | Description |
---|---|---|
range1 | IRange | The source range |
range2 | IRange | The range to be subtracted |
Returns
IRange
[]
Returns the array of ranges, which are the result not intersected with range1
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:283
subtractMulti()
static subtractMulti(ranges1, ranges2): IRange[]
Parameters
Parameter | Type |
---|---|
ranges1 | IRange [] |
ranges2 | IRange [] |
Returns
IRange
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:357
union()
static union(...ranges): IRange
Parameters
Parameter | Type |
---|---|
…ranges | IRange [] |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rectangle.ts:212