1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Gantt bars for single-day tasks may be rendered wrongly in PDF (#23645).

Patch by Daniel Ritz.


git-svn-id: http://svn.redmine.org/redmine/trunk@19592 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2020-03-20 04:48:15 +00:00
parent 67212d1d00
commit 94777d40b0

View File

@ -945,21 +945,24 @@ module Redmine
height /= 2 if markers height /= 2 if markers
# Renders the task bar, with progress and late # Renders the task bar, with progress and late
if coords[:bar_start] && coords[:bar_end] if coords[:bar_start] && coords[:bar_end]
width = [1, coords[:bar_end] - coords[:bar_start]].max
params[:pdf].SetY(params[:top] + 1.5) params[:pdf].SetY(params[:top] + 1.5)
params[:pdf].SetX(params[:subject_width] + coords[:bar_start]) params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
params[:pdf].SetFillColor(200, 200, 200) params[:pdf].SetFillColor(200, 200, 200)
params[:pdf].RDMCell(coords[:bar_end] - coords[:bar_start], height, "", 0, 0, "", 1) params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
if coords[:bar_late_end] if coords[:bar_late_end]
width = [1, coords[:bar_late_end] - coords[:bar_start]].max
params[:pdf].SetY(params[:top] + 1.5) params[:pdf].SetY(params[:top] + 1.5)
params[:pdf].SetX(params[:subject_width] + coords[:bar_start]) params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
params[:pdf].SetFillColor(255, 100, 100) params[:pdf].SetFillColor(255, 100, 100)
params[:pdf].RDMCell(coords[:bar_late_end] - coords[:bar_start], height, "", 0, 0, "", 1) params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
end end
if coords[:bar_progress_end] if coords[:bar_progress_end]
width = [1, coords[:bar_progress_end] - coords[:bar_start]].max
params[:pdf].SetY(params[:top] + 1.5) params[:pdf].SetY(params[:top] + 1.5)
params[:pdf].SetX(params[:subject_width] + coords[:bar_start]) params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
params[:pdf].SetFillColor(90, 200, 90) params[:pdf].SetFillColor(90, 200, 90)
params[:pdf].RDMCell(coords[:bar_progress_end] - coords[:bar_start], height, "", 0, 0, "", 1) params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
end end
end end
# Renders the markers # Renders the markers