Skip to content

Commit

Permalink
Merge pull request #99 from sprain/improve-pdf-offset
Browse files Browse the repository at this point in the history
Use floats for offset in pdf outputs
  • Loading branch information
sprain authored Nov 8, 2020
2 parents 40f9def + a128edc commit f270714
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/PaymentPart/Output/FpdfOutput/FpdfOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ final class FpdfOutput extends AbstractOutput implements OutputInterface
/** @var float */
private $amountLS = 0;

/* @var int */
/* @var float */
private $offsetX;

/* @var int */
/* @var float */
private $offsetY;

public function __construct(
QrBill $qrBill,
string $language,
Fpdf $fpdf,
int $offsetX = 0,
int $offsetY = 0
float $offsetX = 0,
float $offsetY = 0
) {
parent::__construct($qrBill, $language);
$this->fpdf = $fpdf;
Expand Down
12 changes: 6 additions & 6 deletions src/PaymentPart/Output/TcPdfOutput/TcPdfOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ final class TcPdfOutput extends AbstractOutput implements OutputInterface
/* @var TCPDF */
private $tcPdf;

/* @var int */
/* @var float */
private $offsetX;

/* @var int */
/* @var float */
private $offsetY;

public function __construct(
QrBill $qrBill,
string $language,
TCPDF $tcPdf,
int $offsetX = 0,
int $offsetY = 0
float $offsetX = 0,
float $offsetY = 0
) {
parent::__construct($qrBill, $language);
$this->tcPdf = $tcPdf;
Expand Down Expand Up @@ -231,8 +231,8 @@ private function addSeparatorContentIfNotPrintable(): void
{
if (!$this->isPrintable()) {
$this->tcPdf->SetLineStyle(['width' => 0.1, 'color' => [0, 0, 0]]);
$this->printLine(2 + $this->offsetX, 193 + $this->offsetY, 208 + $this->offsetX, 193 + $this->offsetY);
$this->printLine(62 + $this->offsetX, 193 + $this->offsetY, 62 + $this->offsetX, 296 + $this->offsetY);
$this->printLine(2, 193, 208, 193);
$this->printLine(62, 193, 62, 296);
$this->tcPdf->SetFont(self::FONT, '', self::FONT_SIZE_FURTHER_INFORMATION);
$this->SetY(188);
$this->SetX(5);
Expand Down

0 comments on commit f270714

Please sign in to comment.