mirror of
https://github.com/Intervention/image.git
synced 2025-08-11 08:24:02 +02:00
Fix bugs in CropModifiers
This commit is contained in:
@@ -92,7 +92,7 @@ class CropModifier extends SpecializedModifier
|
||||
}
|
||||
|
||||
// cover the possible newly created areas with background color
|
||||
if ($this->offset_x < 0 || $resizeTo->pivot()->x() != 0) {
|
||||
if ((($this->offset_x * -1) - $resizeTo->pivot()->x() - 1) > 0) {
|
||||
imagefilledrectangle(
|
||||
$modified,
|
||||
0,
|
||||
@@ -104,7 +104,7 @@ class CropModifier extends SpecializedModifier
|
||||
}
|
||||
|
||||
// cover the possible newly created areas with background color
|
||||
if ($this->offset_y < 0 || $resizeTo->pivot()->y() != 0) {
|
||||
if ((($this->offset_y * -1) - $resizeTo->pivot()->y() - 1) > 0) {
|
||||
imagefilledrectangle(
|
||||
$modified,
|
||||
($this->offset_x * -1) - $resizeTo->pivot()->x(),
|
||||
|
@@ -64,7 +64,7 @@ class CropModifier extends DriverSpecializedModifier
|
||||
}
|
||||
|
||||
// cover the possible newly created areas with background color
|
||||
if ($this->offset_x < 0 || $crop->pivot()->x() != 0) {
|
||||
if ((($this->offset_x * -1) - $crop->pivot()->x() - 1) > 0) {
|
||||
$draw->rectangle(
|
||||
0,
|
||||
0,
|
||||
@@ -74,7 +74,7 @@ class CropModifier extends DriverSpecializedModifier
|
||||
}
|
||||
|
||||
// cover the possible newly created areas with background color
|
||||
if ($this->offset_y < 0 || $crop->pivot()->y() != 0) {
|
||||
if ((($this->offset_y * -1) - $crop->pivot()->y() - 1) > 0) {
|
||||
$draw->rectangle(
|
||||
($this->offset_x * -1) - $crop->pivot()->x(),
|
||||
0,
|
||||
|
Reference in New Issue
Block a user