mirror of
https://github.com/Intervention/image.git
synced 2025-08-30 09:10:21 +02:00
Add method to SizeInterface
This commit is contained in:
@@ -201,7 +201,7 @@ class Size implements SizeInterface
|
||||
* @param Size $size
|
||||
* @return Point
|
||||
*/
|
||||
public function getRelativePositionTo(Size $size): Point
|
||||
public function getRelativePositionTo(SizeInterface $size): PointInterface
|
||||
{
|
||||
$x = $this->getPivot()->getX() - $size->getPivot()->getX();
|
||||
$y = $this->getPivot()->getY() - $size->getPivot()->getY();
|
||||
|
@@ -17,4 +17,5 @@ interface SizeInterface
|
||||
public function alignPivot(string $position, int $offset_x = 0, int $offset_y = 0): SizeInterface;
|
||||
public function alignPivotTo(SizeInterface $size, string $position): SizeInterface;
|
||||
public function contain(int $width, int $height): SizeInterface;
|
||||
public function getRelativePositionTo(SizeInterface $size): PointInterface;
|
||||
}
|
||||
|
Reference in New Issue
Block a user