プロジェクト

全般

プロフィール

Vote #76122

完了

End markers in gantt PDF are misaligned

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Gantt_34
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
34
version_id:
159
issue_org_id:
19248
author_id:
122481
assigned_to_id:
332
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
80
ステータス-->[Closed]

説明

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


journals

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|
|!{width:500px;border:1px solid #ccc;}expect.png!|!{width:500px;border:1px solid #ccc;}actual.png!|

Improved with the following patch.

<pre><code class="diff">
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, '&nbsp;'.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' % [
</code></pre>

--------------------------------------------------------------------------------
Setting the target version to 4.1.1.
--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリGantt_34 にセット
  • 対象バージョン4.0.7_159 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0