Skip to content

Commit

Permalink
Fixed bug where svg polylines get automatically closed
Browse files Browse the repository at this point in the history
  • Loading branch information
mck89 authored and bsweeney committed Jan 5, 2023
1 parent 4beb15e commit f586c13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Cpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4220,19 +4220,19 @@ function rect($x1, $y1, $width, $height)
$this->addContent(sprintf("\n%.3F %.3F %.3F %.3F re", $x1, $y1, $width, $height));
}

function stroke()
function stroke(bool $close = false)
{
$this->addContent("\nS");
$this->addContent("\n" . ($close ? "s" : "S"));
}

function fill()
{
$this->addContent("\nf" . ($this->fillRule === "evenodd" ? "*" : ""));
}

function fillStroke()
function fillStroke(bool $close = false)
{
$this->addContent("\nb" . ($this->fillRule === "evenodd" ? "*" : ""));
$this->addContent("\n" . ($close ? "b" : "B") . ($this->fillRule === "evenodd" ? "*" : ""));
}

/**
Expand Down

0 comments on commit f586c13

Please sign in to comment.