Updating the title and dates height for pdf.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 24 Apr 2017 18:45:13 +0000 (14:45 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 24 Apr 2017 18:45:13 +0000 (14:45 -0400)
In the pdf have to see if either the title or date is more than one
line. If it is then adjust the next Y position for the start of the
address. This is so the address doesn't overlap the title.

models/front/events/list.php

index e6d39e5..34ffd0e 100644 (file)
@@ -462,16 +462,16 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction
                     $title->setText(html_entity_decode( $event['name'], ENT_HTML5 ) );
                     //$title->setAlign('center');
                     $title->setWidth(self::TITLE_WIDTH);
-                    $lineCount = $title->getLineCount();
-                    if ( $title->getLineCount() > 1 ) {
+                    $lineCountTitle = $title->getLineCount() - 1;
+                    if ( $lineCountTitle ) {
                         $pdfY -= $title->getLineHeight();
                     }
                     $title->draw($page->getCanvas(), self::PDF_RGT_COL_X, $pdfY);
-                    if ( $title->getLineCount() > 1 ) {
-                        $pdfY += $title->getLineHeight();
-                    }
 
                     $pdfY -= self::LINE_HEIGHT;
+                    if ( $lineCountTitle ) {
+                        $pdfY -= $title->getLineCount();
+                    }
                     if ( $lineCount ) {
                         $pdfY -= $dateHeight;
                     }