From: Steve Sutton Date: Mon, 24 Apr 2017 18:45:13 +0000 (-0400) Subject: Updating the title and dates height for pdf. X-Git-Tag: v1.6.37^2~11 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=371900a592b7b65578550db8199fd907c363d698;p=WP-Plugins%2Fglm-member-db-events.git Updating the title and dates height for pdf. 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. --- diff --git a/models/front/events/list.php b/models/front/events/list.php index e6d39e5..34ffd0e 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -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; }