From 3da3bad2ab4b31050667cc1c87727d7ae67bdd99 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 22 May 2022 19:03:49 +0200 Subject: [PATCH] Add method to SizeInterface --- src/Geometry/Size.php | 2 +- src/Interfaces/SizeInterface.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Geometry/Size.php b/src/Geometry/Size.php index d05d0417..9bffaf07 100644 --- a/src/Geometry/Size.php +++ b/src/Geometry/Size.php @@ -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(); diff --git a/src/Interfaces/SizeInterface.php b/src/Interfaces/SizeInterface.php index ba8fef44..da4a6821 100644 --- a/src/Interfaces/SizeInterface.php +++ b/src/Interfaces/SizeInterface.php @@ -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; }