Defect #19248
End markers in gantt PDF are misaligned
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Gantt | |||
Target version: | 4.0.7 | |||
Resolution: | Fixed | Affected version: | 3.0.0 |
Description
the line end's mark appears between the end date -1 and the end day,
it's better to display it between the end day and the end date + 1.
by modify ../redmine/helpers/gantt.rb
def pdf_task
Environment:
Redmine version 3.0.0.stable
Associated revisions
Fix that end markers in gantt PDF are misaligned (#19248).
Patch by Yuichi HARADA.
History
#1
Updated by Yuichi HARADA 10 months ago
- File expect.png added
- File actual.png added
- File 19248.patch
added
I confirmed that the display position of the end mark was shifted. In addition, the display position of the end mark of the PNG image was shifted similarly.
expect | actual |
---|---|
![]() |
![]() |
Improved with the following patch.
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index 285eb66a0..406a818e1 100644
--- a/lib/redmine/helpers/gantt.rb
+++ b/lib/redmine/helpers/gantt.rb
@@ -631,7 +631,7 @@ module Redmine
coords[:bar_start] = 0
end
if end_date < self.date_to
- coords[:end] = end_date - self.date_from
+ coords[:end] = end_date - self.date_from + 1
coords[:bar_end] = end_date - self.date_from + 1
else
coords[:bar_end] = self.date_to - self.date_from + 1
@@ -897,7 +897,7 @@ module Redmine
if coords[:end]
style = +""
style << "top:#{params[:top]}px;"
- style << "left:#{coords[:end] + params[:zoom]}px;"
+ style << "left:#{coords[:end]}px;"
style << "width:15px;"
output << view.content_tag(:div, ' '.html_safe,
:style => style,
@@ -1031,7 +1031,7 @@ module Redmine
])
end
if coords[:end]
- x = params[:subject_width] + coords[:end] + params[:zoom]
+ x = params[:subject_width] + coords[:end]
y = params[:top] - height / 2
params[:image].fill('blue')
params[:image].draw('polygon %d,%d %d,%d %d,%d %d,%d' % [
#3
Updated by Go MAEDA 10 months ago
- Subject changed from gantt's pdf line end mark's position to End markers in gantt PDF are misaligned
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Priority changed from Low to Normal
- Target version changed from 4.1.1 to 4.0.7
- Resolution set to Fixed
Committed the fix. Thank you.