From 58d7312d9e78fd7219edb7404dd790b446d5d30c Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Wed, 5 Aug 2015 15:23:08 +1000 Subject: [PATCH] Improved alignment handling Fixed a bug for right aligning elements with top right reference point. --- element/element.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/element/element.class.php b/element/element.class.php index 2b395a8..4ba4999 100644 --- a/element/element.class.php +++ b/element/element.class.php @@ -204,6 +204,8 @@ abstract class customcert_element_base { if ($x < 0) { $x = 0; $w = $this->element->posx; + } else { + $w = $actualwidth; } break; case CUSTOMCERT_REF_POINT_TOPCENTER: @@ -211,10 +213,16 @@ abstract class customcert_element_base { if ($x < 0) { $x = 0; $w = $this->element->posx * 2; + } else { + $w = $actualwidth; } break; } + if ($w) { + $w += 0.0001; + } + $pdf->setCellPaddings(0, 0, 0, 0); $pdf->writeHTMLCell($w, 0, $x, $y, $content, 0, 0, false, true, $align); }