setasign\SetaPDF2\Core\Geometry
Rectangle Class representing a rectangle
File: /SetaPDF v2/Core/Geometry/Rectangle.php
Old class name (alias):
\SetaPDF_Core_Geometry_Rectangle
Class hierarchy
Implements
Summary
Properties
Methods
__construct()
The constructor.
There three ways to create a rectangle:
- 2 params \setasign\SetaPDF2\Core\Geometry\Point $a point1 \setasign\SetaPDF2\Core\Geometry\Point $b point2 - 3 params \setasign\SetaPDF2\Core\Geometry\Point $a pointLL int|float $b width int|float $c height - 4 params int|float $a x of point1 int|float $b y of point1 int|float $c x of point2 int|float $d y of point2
Parameters
- $a : int|float|Point
point1 OR pointLL OR x of point1
- $b : int|float|Point
point2 OR width OR y of point1
- $c : int|float
height OR x of point2
- $d : int|float
none OR y of point2
Exceptions
Throws \InvalidArgumentException
_pointInside()
Checks whether a point is inside or on the border of this rectangle.
Parameters
- $x : int|float
- $y : int|float
- $ignoreEqual : bool
If the point lays on the border and this is true false will be returned
collides()
init()
Reset the complete rectangle by using two opposite points of the new rectangle.
Parameters
- $x1 : int|float
- $y1 : int|float
- $x2 : int|float
- $y2 : int|float
Exceptions
Throws \InvalidArgumentException
intersect()
Checks whether the geometry shape intersect this rectangle.
Parameters
- $geometry : Rectangle
Exceptions
Throws \InvalidArgumentException
setDimensions()
Set the width and the height of the rectangle.
The lower left point couldn't be moved by this method.
Parameters
- $width : int|float
- $height : int|float
Exceptions
Throws \InvalidArgumentException
setHeight()
Set the height of the rectangle.
The lower left point couldn't be moved by this method.
Parameters
- $height : int|float
Exceptions
Throws \InvalidArgumentException
setLl()
Set the lower left point of the rectangle.
If you don't move this point over the x of the lower right or the y of the upper left this point stay the lower left.
If you move this point over only one of them, this point will replace them and the other point will be lower left.
If you move this point over both(x and y), this point will be the new upper right and upper right the new lower left.
Parameters
- $a : int|float|Point
- $b : int|float
setLr()
setUl()
setUr()
setWidth()
Set the width of the rectangle.
The lower left point couldn't be moved by this method.
Parameters
- $width : int|float
Exceptions
Throws \InvalidArgumentException