1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-31 17:41:58 +02:00

Add method to SizeInterface

This commit is contained in:
Oliver Vogel
2022-05-22 19:03:49 +02:00
parent 2de45528dd
commit 3da3bad2ab
2 changed files with 2 additions and 1 deletions

View File

@@ -201,7 +201,7 @@ class Size implements SizeInterface
* @param Size $size * @param Size $size
* @return Point * @return Point
*/ */
public function getRelativePositionTo(Size $size): Point public function getRelativePositionTo(SizeInterface $size): PointInterface
{ {
$x = $this->getPivot()->getX() - $size->getPivot()->getX(); $x = $this->getPivot()->getX() - $size->getPivot()->getX();
$y = $this->getPivot()->getY() - $size->getPivot()->getY(); $y = $this->getPivot()->getY() - $size->getPivot()->getY();

View File

@@ -17,4 +17,5 @@ interface SizeInterface
public function alignPivot(string $position, int $offset_x = 0, int $offset_y = 0): 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 alignPivotTo(SizeInterface $size, string $position): SizeInterface;
public function contain(int $width, int $height): SizeInterface; public function contain(int $width, int $height): SizeInterface;
public function getRelativePositionTo(SizeInterface $size): PointInterface;
} }