Skip to content

Commit

Permalink
Unfortunately current conditions were not covering all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
savioret committed Jul 2, 2023
1 parent bfa830b commit b69c3a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cezpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '')
if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['justification'])) {
$just = $options['cols'][$colName]['justification'];

if ($just == 'full' && (empty($lines[$i + 1]) || count($lines) == $i + 1)) {
if ($just == 'full') {
// do not fully justify if its the absolute last line (taking line breaks into account)
$tmp = $this->addText($pos[$colName], $this->y, $options['fontSize'], $line, $maxWidth[$colName], $just, 0,0,1);
if (!strlen($tmp)) {
Expand Down Expand Up @@ -1977,7 +1977,7 @@ public function ezText($text, $size = 0, $options = [], $test = 0)
$right = $this->ez['pageWidth'] - $this->ez['rightMargin'] - ((is_array($options) && isset($options['right'])) ? $options['right'] : 0);
}

if ($just == 'full' && (empty($lines[$i + 1]) || $c == $i + 1)) {
if ($just == 'full') {
// do not fully justify if its the absolute last line (taking line breaks into account)
$tmp = $this->addText($left, $this->y, $size, $line, $right - $left, $just, 0, 0, 1);
if (!strlen($tmp)) {
Expand Down

0 comments on commit b69c3a7

Please sign in to comment.