From 3413e7c1ae2d3f2243a166bd9e0712fa5a85d9b9 Mon Sep 17 00:00:00 2001 From: Cliff Odijk Date: Fri, 11 Aug 2017 15:42:05 +0200 Subject: [PATCH] Added support for centerright and centerleft position to the BackgroundFilterLoader --- Imagine/Filter/Loader/BackgroundFilterLoader.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Imagine/Filter/Loader/BackgroundFilterLoader.php b/Imagine/Filter/Loader/BackgroundFilterLoader.php index 7f8d8a503..75a4ec8d6 100644 --- a/Imagine/Filter/Loader/BackgroundFilterLoader.php +++ b/Imagine/Filter/Loader/BackgroundFilterLoader.php @@ -62,10 +62,18 @@ public function load(ImageInterface $image, array $options = array()) $x = 0; $y = ($height - $image->getSize()->getHeight()) / 2; break; + case 'centerright': + $x = $width - $image->getSize()->getWidth(); + $y = ($height - $image->getSize()->getHeight()) / 2; + break; case 'center': $x = ($width - $image->getSize()->getWidth()) / 2; $y = ($height - $image->getSize()->getHeight()) / 2; break; + case 'centerleft': + $x = 0; + $y = ($height - $image->getSize()->getHeight()) / 2; + break; case 'right': $x = $width - $image->getSize()->getWidth(); $y = ($height - $image->getSize()->getHeight()) / 2;