public function PositionedRectangle::rotate in Image Effects 8
Same name and namespace in other branches
- 8.3 src/Component/PositionedRectangle.php \Drupal\image_effects\Component\PositionedRectangle::rotate()
- 8.2 src/Component/PositionedRectangle.php \Drupal\image_effects\Component\PositionedRectangle::rotate()
Rotates the rectangle and any additional point.
Parameters
float $angle: Rotation angle.
File
- src/
Component/ PositionedRectangle.php, line 342
Class
- PositionedRectangle
- Rectangle algebra class.
Namespace
Drupal\image_effects\ComponentCode
public function rotate($angle) {
if ($angle) {
$this->angle = $angle;
foreach ($this->points as &$point) {
$this
->rotatePoint($point, $angle);
}
$this
->determineBoundingCorners();
$this->rotationOffset = [
-$this->points['o_a'][0],
-$this->points['o_a'][1],
];
}
return $this;
}