mirror of
https://github.com/Intervention/image.git
synced 2025-08-01 03:20:17 +02:00
Fix deprecation warnings
This commit is contained in:
@@ -300,7 +300,9 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
|
||||
}
|
||||
|
||||
foreach ($this->points as $point) {
|
||||
$point->setX($point->getX() - $diff);
|
||||
$point->setX(
|
||||
intval($point->getX() - $diff)
|
||||
);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -331,7 +333,9 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
|
||||
}
|
||||
|
||||
foreach ($this->points as $point) {
|
||||
$point->setY($point->getY() - $diff);
|
||||
$point->setY(
|
||||
intval($point->getY() - $diff),
|
||||
);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -350,16 +354,24 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
|
||||
|
||||
foreach ($this->points as $point) {
|
||||
// translate point to pivot
|
||||
$point->setX($point->getX() - $this->getPivot()->getX());
|
||||
$point->setY($point->getY() - $this->getPivot()->getY());
|
||||
$point->setX(
|
||||
intval($point->getX() - $this->getPivot()->getX()),
|
||||
);
|
||||
$point->setY(
|
||||
intval($point->getY() - $this->getPivot()->getY()),
|
||||
);
|
||||
|
||||
// rotate point
|
||||
$x = $point->getX() * $cos - $point->getY() * $sin;
|
||||
$y = $point->getX() * $sin + $point->getY() * $cos;
|
||||
|
||||
// translate point back
|
||||
$point->setX($x + $this->getPivot()->getX());
|
||||
$point->setY($y + $this->getPivot()->getY());
|
||||
$point->setX(
|
||||
intval($x + $this->getPivot()->getX()),
|
||||
);
|
||||
$point->setY(
|
||||
intval($y + $this->getPivot()->getY()),
|
||||
);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user