diff --git a/src/Drivers/Gd/Modifiers/CropModifier.php b/src/Drivers/Gd/Modifiers/CropModifier.php index 96a53233..78fed75d 100644 --- a/src/Drivers/Gd/Modifiers/CropModifier.php +++ b/src/Drivers/Gd/Modifiers/CropModifier.php @@ -46,8 +46,8 @@ class CropModifier extends GenericCropModifier implements SpecializedInterface $modified = Cloner::cloneEmpty($frame->native(), $resizeTo, $background); // define offset - $offset_x = $resizeTo->pivot()->x() + $this->offset_x; - $offset_y = $resizeTo->pivot()->y() + $this->offset_y; + $offset_x = $resizeTo->pivot()->x() + $this->x; + $offset_y = $resizeTo->pivot()->y() + $this->y; // define target width & height $targetWidth = min($resizeTo->width(), $originalSize->width()); diff --git a/src/Drivers/Imagick/Modifiers/CropModifier.php b/src/Drivers/Imagick/Modifiers/CropModifier.php index 96c2d72b..d3af1844 100644 --- a/src/Drivers/Imagick/Modifiers/CropModifier.php +++ b/src/Drivers/Imagick/Modifiers/CropModifier.php @@ -28,8 +28,8 @@ class CropModifier extends GenericCropModifier implements SpecializedInterface // define position of the image on the new canvas $crop = $this->crop($image); $position = [ - ($crop->pivot()->x() + $this->offset_x) * -1, - ($crop->pivot()->y() + $this->offset_y) * -1, + ($crop->pivot()->x() + $this->x) * -1, + ($crop->pivot()->y() + $this->y) * -1, ]; foreach ($image as $frame) { diff --git a/src/Image.php b/src/Image.php index 034b6122..5d68bd61 100644 --- a/src/Image.php +++ b/src/Image.php @@ -746,12 +746,12 @@ final class Image implements ImageInterface public function crop( int $width, int $height, - int $offset_x = 0, - int $offset_y = 0, + int $x = 0, + int $y = 0, mixed $background = null, string|Alignment $alignment = Alignment::TOP_LEFT ): ImageInterface { - return $this->modify(new CropModifier($width, $height, $offset_x, $offset_y, $background, $alignment)); + return $this->modify(new CropModifier($width, $height, $x, $y, $background, $alignment)); } /** @@ -772,11 +772,11 @@ final class Image implements ImageInterface public function place( mixed $element, string|Alignment $alignment = Alignment::TOP_LEFT, - int $offset_x = 0, - int $offset_y = 0, + int $x = 0, + int $y = 0, int $opacity = 100 ): ImageInterface { - return $this->modify(new PlaceModifier($element, $alignment, $offset_x, $offset_y, $opacity)); + return $this->modify(new PlaceModifier($element, $alignment, $x, $y, $opacity)); } /** diff --git a/src/Interfaces/ImageInterface.php b/src/Interfaces/ImageInterface.php index ee94a85c..2c9f4a2c 100644 --- a/src/Interfaces/ImageInterface.php +++ b/src/Interfaces/ImageInterface.php @@ -547,8 +547,8 @@ interface ImageInterface extends IteratorAggregate, Countable public function crop( int $width, int $height, - int $offset_x = 0, - int $offset_y = 0, + int $x = 0, + int $y = 0, mixed $background = null, string|Alignment $alignment = Alignment::TOP_LEFT ): self; @@ -573,8 +573,8 @@ interface ImageInterface extends IteratorAggregate, Countable public function place( mixed $element, string|Alignment $alignment = Alignment::TOP_LEFT, - int $offset_x = 0, - int $offset_y = 0, + int $x = 0, + int $y = 0, int $opacity = 100 ): self; diff --git a/src/Modifiers/CropModifier.php b/src/Modifiers/CropModifier.php index 22fa3187..77d1b841 100644 --- a/src/Modifiers/CropModifier.php +++ b/src/Modifiers/CropModifier.php @@ -22,8 +22,8 @@ class CropModifier extends SpecializableModifier public function __construct( public int $width, public int $height, - public int $offset_x = 0, - public int $offset_y = 0, + public int $x = 0, + public int $y = 0, public mixed $background = null, public string|Alignment $alignment = Alignment::TOP_LEFT ) { diff --git a/src/Modifiers/PlaceModifier.php b/src/Modifiers/PlaceModifier.php index 8ff3b0a1..b9a3fddb 100644 --- a/src/Modifiers/PlaceModifier.php +++ b/src/Modifiers/PlaceModifier.php @@ -20,8 +20,8 @@ class PlaceModifier extends SpecializableModifier public function __construct( public mixed $element, public string|Alignment $alignment = Alignment::TOP_LEFT, - public int $offset_x = 0, - public int $offset_y = 0, + public int $x = 0, + public int $y = 0, public int $opacity = 100 ) { // @@ -34,8 +34,8 @@ class PlaceModifier extends SpecializableModifier { $image_size = $image->size()->movePivot( $this->alignment, - $this->offset_x, - $this->offset_y + $this->x, + $this->y ); $watermark_size = $watermark->size()->movePivot(