xref: /webtrees/app/Report/ReportPdfLine.php (revision 1e71bdc0ba6fc5add8fed9a3beb51cfca09e47dd)
1<?php
2namespace Fisharebest\Webtrees;
3
4/**
5 * webtrees: online genealogy
6 * Copyright (C) 2015 webtrees development team
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * Class ReportPdfLine
21 */
22class ReportPdfLine extends ReportBaseLine {
23	/**
24	 * PDF line renderer
25	 *
26	 * @param PDF $renderer
27	 *
28	 * @return void
29	 */
30	function render($renderer) {
31		if ($this->x1 == ".") {
32			$this->x1 = $renderer->GetX();
33		}
34		if ($this->y1 == ".") {
35			$this->y1 = $renderer->GetY();
36		}
37		if ($this->x2 == ".") {
38			$this->x2 = $renderer->getMaxLineWidth();
39		}
40		if ($this->y2 == ".") {
41			$this->y2 = $renderer->GetY();
42		}
43		if ($renderer->getRTL()) {
44			$renderer->Line($renderer->getPageWidth() - $this->x1, $this->y1, $renderer->getPageWidth() - $this->x2, $this->y2);
45		} else {
46			$renderer->Line($this->x1, $this->y1, $this->x2, $this->y2);
47		}
48	}
49}
50