. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Report; /** * Class ReportPdfLine */ class ReportPdfLine extends ReportBaseLine { /** * PDF line renderer * * @param PdfRenderer $renderer * * @return void */ public function render($renderer): void { if ($this->x1 === ReportBaseElement::CURRENT_POSITION) { $this->x1 = $renderer->tcpdf->GetX(); } if ($this->y1 === ReportBaseElement::CURRENT_POSITION) { $this->y1 = $renderer->tcpdf->GetY(); } if ($this->x2 === ReportBaseElement::CURRENT_POSITION) { $this->x2 = $renderer->getMaxLineWidth(); } if ($this->y2 === ReportBaseElement::CURRENT_POSITION) { $this->y2 = $renderer->tcpdf->GetY(); } if ($renderer->tcpdf->getRTL()) { $renderer->tcpdf->Line($renderer->tcpdf->getPageWidth() - $this->x1, $this->y1, $renderer->tcpdf->getPageWidth() - $this->x2, $this->y2); } else { $renderer->tcpdf->Line($this->x1, $this->y1, $this->x2, $this->y2); } } }