diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-02-01 00:01:36 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-02-02 17:34:31 +0000 |
| commit | a25f0a04682c4c39c1947220c90af4118c713952 (patch) | |
| tree | f7e9c2c630a50dd3e5dd76ce501dff4b1d8d4c26 /app/Report/ReportHtmlLine.php | |
| parent | 4d2a5476ceb1c11dc1fd146bfb0be077baa5fb01 (diff) | |
| download | webtrees-a25f0a04682c4c39c1947220c90af4118c713952.tar.gz webtrees-a25f0a04682c4c39c1947220c90af4118c713952.tar.bz2 webtrees-a25f0a04682c4c39c1947220c90af4118c713952.zip | |
Refactor classes to use namespaces, as per PSR-4. Replace GPL2 with GPL3.
Diffstat (limited to 'app/Report/ReportHtmlLine.php')
| -rw-r--r-- | app/Report/ReportHtmlLine.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/app/Report/ReportHtmlLine.php b/app/Report/ReportHtmlLine.php new file mode 100644 index 0000000000..de322f8d86 --- /dev/null +++ b/app/Report/ReportHtmlLine.php @@ -0,0 +1,57 @@ +<?php +namespace Webtrees; + +/** + * webtrees: online genealogy + * Copyright (C) 2015 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/** + * Class ReportHtmlLine + */ +class ReportHtmlLine extends ReportBaseLine { + /** + * HTML line renderer + * + * @param ReportHtml $renderer + * + * @return void + */ + function render($renderer) { + if ($this->x1 == '.') { + $this->x1 = $renderer->getX(); + } + if ($this->y1 == '.') { + $this->y1 = $renderer->getY(); + } + if ($this->x2 == '.') { + $this->x2 = $renderer->getRemainingWidth(); + } + if ($this->y2 == '.') { + $this->y2 = $renderer->getY(); + } + // TODO Non verticle or horizontal lines can use a series of divs absolutely positioned + // Vertical line + if ($this->x1 == $this->x2) { + echo "<div style=\"position:absolute;overflow:hidden;border-", $renderer->alignRTL, ":solid black 1pt;", $renderer->alignRTL, ":", $this->x1, "pt;top:", $this->y1 + 1, "pt;width:1pt;height:", $this->y2 - $this->y1, "pt;\"> </div>\n"; + } + // Horizontal line + if ($this->y1 == $this->y2) { + echo "<div style=\"position:absolute;overflow:hidden;border-top:solid black 1pt;", $renderer->alignRTL, ":", $this->x1, "pt;top:", $this->y1 + 1, "pt;width:", $this->x2 - $this->x1, "pt;height:1pt;\"> </div>\n"; + } + // Keep max Y updated + // One or the other will be higher... lasy mans way... + $renderer->addMaxY($this->y1); + $renderer->addMaxY($this->y2); + } +} |
