mirror of
https://github.com/Intervention/image.git
synced 2025-09-02 02:12:37 +02:00
Added change requests from @olivervogel
This commit is contained in:
@@ -85,7 +85,7 @@ class DrawBezierModifier extends ModifiersDrawBezierModifier implements Speciali
|
|||||||
* @param float $t
|
* @param float $t
|
||||||
* @return array{'x': float, 'y': float}
|
* @return array{'x': float, 'y': float}
|
||||||
*/
|
*/
|
||||||
public function calculateQuadraticBezierInterpolationPoint(float $t = 0.05): array
|
private function calculateQuadraticBezierInterpolationPoint(float $t = 0.05): array
|
||||||
{
|
{
|
||||||
$remainder = 1 - $t;
|
$remainder = 1 - $t;
|
||||||
$control_point_1_multiplier = $remainder * $remainder;
|
$control_point_1_multiplier = $remainder * $remainder;
|
||||||
@@ -112,7 +112,7 @@ class DrawBezierModifier extends ModifiersDrawBezierModifier implements Speciali
|
|||||||
* @param float $t
|
* @param float $t
|
||||||
* @return array{'x': float, 'y': float}
|
* @return array{'x': float, 'y': float}
|
||||||
*/
|
*/
|
||||||
public function calculateCubicBezierInterpolationPoint(float $t = 0.05): array
|
private function calculateCubicBezierInterpolationPoint(float $t = 0.05): array
|
||||||
{
|
{
|
||||||
$remainder = 1 - $t;
|
$remainder = 1 - $t;
|
||||||
$t_squared = $t * $t;
|
$t_squared = $t * $t;
|
||||||
@@ -144,7 +144,7 @@ class DrawBezierModifier extends ModifiersDrawBezierModifier implements Speciali
|
|||||||
* @throws GeometryException
|
* @throws GeometryException
|
||||||
* @return array{0: array<mixed>, 1: array<mixed>}
|
* @return array{0: array<mixed>, 1: array<mixed>}
|
||||||
*/
|
*/
|
||||||
public function calculateBezierPoints(): array
|
private function calculateBezierPoints(): array
|
||||||
{
|
{
|
||||||
if ($this->drawable->count() !== 3 && $this->drawable->count() !== 4) {
|
if ($this->drawable->count() !== 3 && $this->drawable->count() !== 4) {
|
||||||
throw new GeometryException('You must specify either 3 or 4 points to create a bezier curve');
|
throw new GeometryException('You must specify either 3 or 4 points to create a bezier curve');
|
||||||
|
@@ -752,7 +752,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Draw a bezier curve on the current image
|
* Draw a bezier curve on the current image
|
||||||
*
|
*
|
||||||
* @link
|
* @link https://image.intervention.io/v3/modifying/drawing#draw-bezier-curves
|
||||||
* @param callable $init
|
* @param callable $init
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
|
Reference in New Issue
Block a user