From fdb6de62984aa8d441c9021d10ced288fceef64e Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 22 May 2022 11:03:50 +0200 Subject: [PATCH] Add methods to SizeInterface --- src/Geometry/Size.php | 2 +- src/Interfaces/SizeInterface.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Geometry/Size.php b/src/Geometry/Size.php index 797c15bc..1d1e44e3 100644 --- a/src/Geometry/Size.php +++ b/src/Geometry/Size.php @@ -182,7 +182,7 @@ class Size implements SizeInterface return $this; } - public function alignPivotTo(Size $size, string $position): self + public function alignPivotTo(SizeInterface $size, string $position): self { $reference = new Size($size->getWidth(), $size->getHeight()); $reference->alignPivot($position); diff --git a/src/Interfaces/SizeInterface.php b/src/Interfaces/SizeInterface.php index fd641fbe..92ba6674 100644 --- a/src/Interfaces/SizeInterface.php +++ b/src/Interfaces/SizeInterface.php @@ -14,4 +14,6 @@ interface SizeInterface public function fitsInto(SizeInterface $size): bool; public function isLandscape(): bool; public function isPortrait(): bool; + public function alignPivot(string $position, int $offset_x = 0, int $offset_y = 0): SizeInterface; + public function alignPivotTo(SizeInterface $size, string $position): SizeInterface; }