https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292020-03-18T01:15:11ZRedmineRedmine - Defect #19248: End markers in gantt PDF are misalignedhttps://www.redmine.org/issues/19248?journal_id=968162020-03-18T01:15:11ZYuichi HARADA
<ul><li><strong>File</strong> <a href="/attachments/25032">expect.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25032/expect.png">expect.png</a> added</li><li><strong>File</strong> <a href="/attachments/25033">actual.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25033/actual.png">actual.png</a> added</li><li><strong>File</strong> <a href="/attachments/25034">19248.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25034/19248.patch">19248.patch</a> added</li></ul><p>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.</p>
<table>
<tr>
<th>expect</th>
<th>actual</th>
</tr>
<tr>
<td><img src="https://www.redmine.org/attachments/download/25032/expect.png" style="width:500px;border:1px solid #ccc;" alt="" /></td>
<td><img src="https://www.redmine.org/attachments/download/25033/actual.png" style="width:500px;border:1px solid #ccc;" alt="" /></td>
</tr>
</table>
<p>Improved with the following patch.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index 285eb66a0..406a818e1 100644
</span><span class="gd">--- a/lib/redmine/helpers/gantt.rb
</span><span class="gi">+++ b/lib/redmine/helpers/gantt.rb
</span><span class="p">@@ -631,7 +631,7 @@</span> module Redmine
coords[:bar_start] = 0
end
if end_date < self.date_to
<span class="gd">- coords[:end] = end_date - self.date_from
</span><span class="gi">+ coords[:end] = end_date - self.date_from + 1
</span> coords[:bar_end] = end_date - self.date_from + 1
else
coords[:bar_end] = self.date_to - self.date_from + 1
<span class="p">@@ -897,7 +897,7 @@</span> module Redmine
if coords[:end]
style = +""
style << "top:#{params[:top]}px;"
<span class="gd">- style << "left:#{coords[:end] + params[:zoom]}px;"
</span><span class="gi">+ style << "left:#{coords[:end]}px;"
</span> style << "width:15px;"
output << view.content_tag(:div, '&nbsp;'.html_safe,
:style => style,
<span class="p">@@ -1031,7 +1031,7 @@</span> module Redmine
])
end
if coords[:end]
<span class="gd">- x = params[:subject_width] + coords[:end] + params[:zoom]
</span><span class="gi">+ x = params[:subject_width] + coords[:end]
</span> y = params[:top] - height / 2
params[:image].fill('blue')
params[:image].draw('polygon %d,%d %d,%d %d,%d %d,%d' % [
</code></pre> Redmine - Defect #19248: End markers in gantt PDF are misalignedhttps://www.redmine.org/issues/19248?journal_id=968492020-03-19T14:36:28ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>4.1.1</i></li></ul><p>Setting the target version to 4.1.1.</p> Redmine - Defect #19248: End markers in gantt PDF are misalignedhttps://www.redmine.org/issues/19248?journal_id=968642020-03-20T06:25:46ZGo MAEDA
<ul><li><strong>Subject</strong> changed from <i>gantt's pdf line end mark's position</i> to <i>End markers in gantt PDF are misaligned</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Priority</strong> changed from <i>Low</i> to <i>Normal</i></li><li><strong>Target version</strong> changed from <i>4.1.1</i> to <i>4.0.7</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed the fix. Thank you.</p>