Skip to content

Commit

Permalink
Fixes problem with red border in ellipse, arc and roundedRectangle (#273
Browse files Browse the repository at this point in the history
)
  • Loading branch information
maPer77 authored Apr 20, 2021
1 parent 255d9e7 commit 0fde9fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/claviska/SimpleImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ public function arc($x, $y, $width, $height, $start, $end, $color, $thickness =
imagefilledarc($tempImage->image, $x, $y, $width+$thickness, $height+$thickness, $start, $end, $tempColor, IMG_ARC_PIE);

// Draw a smaller ellipse filled with red|blue (-$thickness pixels)
$tempColor = ($color == 'red') ? 'blue' : 'red';
$tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red';
$tempColor = $tempImage->allocateColor($tempColor);
imagefilledarc($tempImage->image, $x, $y, $width-$thickness, $height-$thickness, $start, $end, $tempColor, IMG_ARC_PIE);

Expand Down Expand Up @@ -1460,7 +1460,7 @@ public function ellipse($x, $y, $width, $height, $color, $thickness = 1) {
imagefilledellipse($tempImage->image, $x, $y, $width+$thickness, $height+$thickness, $tempColor);

// Draw a smaller ellipse filled with red|blue (-$thickness pixels)
$tempColor = ($color == 'red') ? 'blue' : 'red';
$tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red';
$tempColor = $tempImage->allocateColor($tempColor);
imagefilledellipse($tempImage->image, $x, $y, $width-$thickness, $height-$thickness, $tempColor);

Expand Down Expand Up @@ -1620,7 +1620,7 @@ public function roundedRectangle($x1, $y1, $x2, $y2, $radius, $color, $thickness
$tempImage->roundedRectangle($x1, $y1, $x2, $y2, $radius, $color,'filled');

// Draw a smaller rectangle filled with red|blue (-$thickness pixels on each side)
$tempColor = ($color == 'red') ? 'blue' : 'red';
$tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red';
$radius = $radius - $thickness;
$radius = self::keepWithin($radius, 0, $radius);
$tempImage->roundedRectangle(
Expand Down

0 comments on commit 0fde9fe

Please sign in to comment.