1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-29 09:47:36 +01:00

circle is defined by width

This commit is contained in:
Oliver Vogel 2014-05-11 17:25:01 +02:00
parent d1e923455e
commit b5936b46d6

View File

@ -19,12 +19,12 @@ class EllipseShape extends \Intervention\Image\AbstractShape
public function applyToImage(Image $image, $x = 0, $y = 0)
{
$background = new Color($this->background);
imagefilledellipse($image->getCore(), $x, $y, $this->width * 2, $this->height * 2, $background->getInt());
imagefilledellipse($image->getCore(), $x, $y, $this->width, $this->height, $background->getInt());
if ($this->hasBorder()) {
$border_color = new Color($this->border_color);
imagesetthickness($image->getCore(), $this->border_width);
imageellipse($image->getCore(), $x, $y, $this->width * 2, $this->height * 2, $border_color->getInt());
imageellipse($image->getCore(), $x, $y, $this->width, $this->height, $border_color->getInt());
}
return true;