mirror of
https://github.com/Intervention/image.git
synced 2025-09-01 09:52:59 +02:00
Change behaviour of the position argument of ResizeCanvasModifier
This commit is contained in:
@@ -22,6 +22,16 @@ class ResizeCanvasModifier extends AbstractModifier
|
||||
$height = is_null($this->height) ? $image->height() : $this->height;
|
||||
|
||||
return (new Rectangle($width, $height))
|
||||
->alignPivotTo($image->size(), $this->position);
|
||||
->alignPivotTo($image->size(), $this->position());
|
||||
}
|
||||
|
||||
protected function position(): string
|
||||
{
|
||||
return strtr($this->position, [
|
||||
'left' => 'right',
|
||||
'right' => 'left',
|
||||
'top' => 'bottom',
|
||||
'bottom' => 'top',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user