Project

General

Profile

Defect #23645 » gantt-single-day-task-pdf-rendering.patch

Daniel Ritz, 2016-08-23 18:48

View differences:

lib/redmine/helpers/gantt.rb
860 860
        height /= 2 if markers
861 861
        # Renders the task bar, with progress and late
862 862
        if coords[:bar_start] && coords[:bar_end]
863
          width = [1, coords[:bar_end] - coords[:bar_start]].max
863 864
          params[:pdf].SetY(params[:top] + 1.5)
864 865
          params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
865 866
          params[:pdf].SetFillColor(200, 200, 200)
866
          params[:pdf].RDMCell(coords[:bar_end] - coords[:bar_start], height, "", 0, 0, "", 1)
867
          params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
867 868
          if coords[:bar_late_end]
869
            width = [1, coords[:bar_late_end] - coords[:bar_start]].max
868 870
            params[:pdf].SetY(params[:top] + 1.5)
869 871
            params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
870 872
            params[:pdf].SetFillColor(255, 100, 100)
871
            params[:pdf].RDMCell(coords[:bar_late_end] - coords[:bar_start], height, "", 0, 0, "", 1)
873
            params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
872 874
          end
873 875
          if coords[:bar_progress_end]
876
            width = [1, coords[:bar_progress_end] - coords[:bar_start]].max
874 877
            params[:pdf].SetY(params[:top] + 1.5)
875 878
            params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
876 879
            params[:pdf].SetFillColor(90, 200, 90)
877
            params[:pdf].RDMCell(coords[:bar_progress_end] - coords[:bar_start], height, "", 0, 0, "", 1)
880
            params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
878 881
          end
879 882
        end
880 883
        # Renders the markers
(1-1/5)