diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-07 18:53:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-07 18:53:15 +0000 |
commit | 9c6377964c43ed034cf644a22311810629f42934 (patch) | |
tree | 80664bd8819df51955cb17a119318e38c95cdfca /lib/redmine | |
parent | b17e145d75f926d435fdac81af0d9629d75149a0 (diff) | |
download | redmine-9c6377964c43ed034cf644a22311810629f42934.tar.gz redmine-9c6377964c43ed034cf644a22311810629f42934.zip |
Fixes gantt PDF pagination problem (#6348).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4474 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/helpers/gantt.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index c6a54d32c..fa3a1259c 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -246,6 +246,7 @@ module Redmine options[:image].stroke_width(1) options[:image].text(options[:indent], options[:top] + 2, project.name) when :pdf + pdf_new_page?(options) options[:pdf].SetY(options[:top]) options[:pdf].SetX(15) @@ -381,6 +382,7 @@ module Redmine options[:image].stroke_width(1) options[:image].text(options[:indent], options[:top] + 2, version.to_s_with_project) when :pdf + pdf_new_page?(options) options[:pdf].SetY(options[:top]) options[:pdf].SetX(15) @@ -535,6 +537,7 @@ module Redmine options[:image].stroke_width(1) options[:image].text(options[:indent], options[:top] + 2, issue.subject) when :pdf + pdf_new_page?(options) options[:pdf].SetY(options[:top]) options[:pdf].SetX(15) @@ -921,7 +924,7 @@ module Redmine :g_width => g_width, :indent => 0, :indent_increment => 5, - :top_increment => 3, + :top_increment => 5, :format => :pdf, :pdf => pdf } @@ -943,6 +946,15 @@ module Redmine cmp end end + + def pdf_new_page?(options) + if options[:top] > 180 + options[:pdf].Line(15, options[:top], PDF::TotalWidth, options[:top]) + options[:pdf].AddPage("L") + options[:top] = 15 + options[:pdf].Line(15, options[:top] - 0.1, PDF::TotalWidth, options[:top] - 0.1) + end + end end end end |