lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b1ab0fa 126/156: Leave a gap between upper fo


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b1ab0fa 126/156: Leave a gap between upper footer part and main page contents
Date: Tue, 30 Jan 2018 17:22:28 -0500 (EST)

branch: master
commit b1ab0fa259e6e8341a77d238798a8e276edd3c50
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>

    Leave a gap between upper footer part and main page contents
    
    If the upper part of the footer is not empty, leave some space between
    it and the main page contents as nothing separates them visually
    otherwise (unlike the lower footer which is separated by a divider
    line).
---
 ledger_pdf_generator_wx.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index a24960c..0d172cf 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -989,6 +989,11 @@ class page_with_footer : public page
                 ,interpolate_html("{{>" + upper_template + "}}")
                 ,e_output_measure_only
                 );
+
+            // Leave a gap between the upper part of the footer and the main
+            // page contents to separate them in absence of a separator line
+            // which delimits the lower part.
+            footer_height += writer.dc().GetCharHeight();
             }
 
         footer_top_ = writer.get_page_bottom() - footer_height;
@@ -1003,14 +1008,18 @@ class page_with_footer : public page
         auto const frame_horz_margin = writer.get_horz_margin();
         auto const frame_width       = writer.get_page_width();
 
+        auto& dc = writer.dc();
+
         auto y = footer_top_;
 
         auto const& upper_template = get_upper_footer_template_name();
         if(!upper_template.empty())
             {
+            y += dc.GetCharHeight();
+
             y += writer.output_html
                 (frame_horz_margin
-                ,footer_top_
+                ,y
                 ,frame_width
                 ,interpolate_html("{{>" + upper_template + "}}")
                 );
@@ -1023,8 +1032,6 @@ class page_with_footer : public page
             ,get_footer_lower_html(interpolate_html)
             );
 
-        auto& dc = writer.dc();
-
         dc.SetPen(HIGHLIGHT_COL);
         dc.DrawLine
             (frame_horz_margin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]