Constructor
A relative rectangle inset in 2D space.
Parameters:
Name | Type | Description |
---|---|---|
args |
object | An object used to initialize the Point. If |
- Default Value:
- { left: 0, top: 0, right: 0, bottom: 0 }
Example
const inset = new PSPDFKit.Geometry.Inset({
left: 5,
top: 15,
right: 10,
bottom: 5
});
inset = inset.set("bottom", 7);
rect.bottom; // => 7
Extends
- Immutable.Record
Members
Methods
Members
The bottom
distance of the inset.
Type:
- number
- Default Value:
- 0
The left
distance of the inset. This is equivalent to x
of a
PSPDFKit.Geometry.Point.
Type:
- number
- Default Value:
- 0
The right
distance of the inset.
Type:
- number
- Default Value:
- 0
The top
distance of the inset. This is equivalent to y
of a
PSPDFKit.Geometry.Point.
Type:
- number
- Default Value:
- 0
Methods
Returns a new Rect by adding the provided inset values to the provided Rect.
Parameters:
Name | Type | Description |
---|---|---|
inset |
Inset | An Inset instance. |
rect |
Rect | A Rect instance. |
Returns:
A new Rect
.
Example
const rect = PSPDFKit.Geometry.Inset.applyToRect(
rectangleAnnotation.cloudyBorderInset,
rectangleAnnotation.boundingBox
);
Returns a new inset using the provided vale for all properties.
Parameters:
Name | Type | Description |
---|---|---|
insetValue |
number | An inset value to be applied to all the properties. |
Returns:
A new Inset
.
Example
const inset = PSPDFKit.Geometry.Inset.fromValue(10);
// inset ->
// {
// left: 10,
// top: 10,
// right: 10,
// bottom: 10,
// }