1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-19 12:11:26 +02:00

Add methods to SizeInterface

This commit is contained in:
Oliver Vogel
2022-05-22 11:03:50 +02:00
parent 6dd434c294
commit fdb6de6298
2 changed files with 3 additions and 1 deletions

View File

@@ -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);

View File

@@ -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;
}