Skip to content

Commit

Permalink
Fixed Clip class
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Oct 12, 2023
1 parent aea7f4d commit fd3792f
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/Clip.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,98 +22,98 @@ class Clip
/**
* Clip constructor.
*
* @param int $x
* @param int $y
* @param int $height
* @param int $width
* @param float $scale
* @param int|float $x
* @param int|float $y
* @param int|float $height
* @param int|float $width
* @param int|float $scale
*/
public function __construct($x, $y, $width, $height, $scale = 1.0)
{
$this->x = $x;
$this->y = $y;
$this->height = $height;
$this->width = $width;
$this->scale = $scale;
$this->x = (float) $x;
$this->y = (float) $y;
$this->height = (float) $height;
$this->width = (float) $width;
$this->scale = (float) $scale;
}

/**
* @return mixed
* @return float
*/
public function getX()
{
return $this->x;
}

/**
* @return mixed
* @return float
*/
public function getY()
{
return $this->y;
}

/**
* @return mixed
* @return float
*/
public function getHeight()
{
return $this->height;
}

/**
* @return mixed
* @return float
*/
public function getWidth()
{
return $this->width;
}

/**
* @return mixed
* @return float
*/
public function getScale()
{
return $this->scale;
}

/**
* @param mixed $x
* @param int|float $x
*/
public function setX($x): void
{
$this->x = $x;
$this->x = (float) $x;
}

/**
* @param mixed $y
* @param int|float $y
*/
public function setY($y): void
{
$this->y = $y;
$this->y = (float) $y;
}

/**
* @param mixed $height
* @param int|float $height
*/
public function setHeight($height): void
{
$this->height = $height;
$this->height = (float) $height;
}

/**
* @param mixed $width
* @param int|float $width
*/
public function setWidth($width): void
{
$this->width = $width;
$this->width = (float) $width;
}

/**
* @param mixed $scale
* @param int|float $scale
*/
public function setScale($scale): void
{
$this->scale = $scale;
$this->scale = (float) $scale;
}
}

0 comments on commit fd3792f

Please sign in to comment.