Skip to content

Commit

Permalink
Merge pull request #974 from JCID/patch-1
Browse files Browse the repository at this point in the history
Added support for centerright and centerleft position
  • Loading branch information
cedricziel authored Aug 28, 2017
2 parents a4fd34a + 3413e7c commit 8e636c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Imagine/Filter/Loader/BackgroundFilterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e636c6

Please sign in to comment.