mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6777 from robbieaverill/bugfix/image-pad-transparency
FIX Add transparency percent argument to Image::generatePad to ensure transparency works from ::Pad
This commit is contained in:
commit
7b9c8afeb9
@ -339,10 +339,11 @@ class Image extends File implements Flushable {
|
||||
*
|
||||
* @param integer $width The width to size to
|
||||
* @param integer $height The height to size to
|
||||
* @param string $backgroundColor The background colour to use on padded sides (default white)
|
||||
* @param integer $transparencyPercent Level of transparency
|
||||
* @return Image|null
|
||||
*/
|
||||
public function Pad($width, $height, $backgroundColor='FFFFFF', $transparencyPercent = 0) {
|
||||
public function Pad($width, $height, $backgroundColor = 'FFFFFF', $transparencyPercent = 0) {
|
||||
return $this->isSize($width, $height) && !Config::inst()->get('Image', 'force_resample')
|
||||
? $this
|
||||
: $this->getFormattedImage('Pad', $width, $height, $backgroundColor, $transparencyPercent);
|
||||
@ -354,12 +355,16 @@ class Image extends File implements Flushable {
|
||||
* @param Image_Backend $backend
|
||||
* @param integer $width The width to size to
|
||||
* @param integer $height The height to size to
|
||||
* @param string $backgroundColor The background colour to use on padded sides (default white)
|
||||
* @param integer $transparencyPercent Level of transparency
|
||||
* @return Image_Backend
|
||||
* @deprecated 4.0 Generate methods are no longer applicable
|
||||
*/
|
||||
public function generatePad(Image_Backend $backend, $width, $height, $backgroundColor='FFFFFF') {
|
||||
public function generatePad(Image_Backend $backend, $width, $height, $backgroundColor = 'FFFFFF',
|
||||
$transparencyPercent = 0
|
||||
) {
|
||||
Deprecation::notice('4.0', 'Generate methods are no longer applicable');
|
||||
return $backend->paddedResize($width, $height, $backgroundColor);
|
||||
return $backend->paddedResize($width, $height, $backgroundColor, $transparencyPercent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user