1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-20 04:31:24 +02:00

Add imagesetthickness on GD's draw modifiers

Make sure that no border is drawn for background colors
This commit is contained in:
Oliver Vogel
2024-06-16 10:44:59 +02:00
parent 6bfd3dd1d4
commit 470b5bfdd8
4 changed files with 4 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ class DrawBezierModifier extends ModifiersDrawBezierModifier implements Speciali
$this->backgroundColor() $this->backgroundColor()
); );
imagesetthickness($frame->native(), 0);
imagefilledpolygon( imagefilledpolygon(
$frame->native(), $frame->native(),
$polygon, $polygon,

View File

@@ -55,6 +55,7 @@ class DrawEllipseModifier extends GenericDrawEllipseModifier implements Speciali
); );
} else { } else {
imagealphablending($frame->native(), true); imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), 0);
imagefilledellipse( imagefilledellipse(
$frame->native(), $frame->native(),
$this->drawable()->position()->x(), $this->drawable()->position()->x(),

View File

@@ -19,6 +19,7 @@ class DrawPolygonModifier extends ModifiersDrawPolygonModifier implements Specia
foreach ($image as $frame) { foreach ($image as $frame) {
if ($this->drawable->hasBackgroundColor()) { if ($this->drawable->hasBackgroundColor()) {
imagealphablending($frame->native(), true); imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), 0);
imagefilledpolygon( imagefilledpolygon(
$frame->native(), $frame->native(),
$this->drawable->toArray(), $this->drawable->toArray(),

View File

@@ -22,6 +22,7 @@ class DrawRectangleModifier extends GenericDrawRectangleModifier implements Spec
// draw background // draw background
if ($this->drawable->hasBackgroundColor()) { if ($this->drawable->hasBackgroundColor()) {
imagealphablending($frame->native(), true); imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), 0);
imagefilledrectangle( imagefilledrectangle(
$frame->native(), $frame->native(),
$position->x(), $position->x(),