1
0
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:
Oliver Vogel
2024-01-09 09:46:16 +01:00
parent 2d2843c37f
commit e93ed68b07
2 changed files with 4 additions and 4 deletions

View File

@@ -92,7 +92,7 @@ class CropModifier extends SpecializedModifier
} }
// cover the possible newly created areas with background color // 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( imagefilledrectangle(
$modified, $modified,
0, 0,
@@ -104,7 +104,7 @@ class CropModifier extends SpecializedModifier
} }
// cover the possible newly created areas with background color // 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( imagefilledrectangle(
$modified, $modified,
($this->offset_x * -1) - $resizeTo->pivot()->x(), ($this->offset_x * -1) - $resizeTo->pivot()->x(),

View File

@@ -64,7 +64,7 @@ class CropModifier extends DriverSpecializedModifier
} }
// cover the possible newly created areas with background color // 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( $draw->rectangle(
0, 0,
0, 0,
@@ -74,7 +74,7 @@ class CropModifier extends DriverSpecializedModifier
} }
// cover the possible newly created areas with background color // 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( $draw->rectangle(
($this->offset_x * -1) - $crop->pivot()->x(), ($this->offset_x * -1) - $crop->pivot()->x(),
0, 0,