From d3d719c0e75086ed874d5af70764242511ee5823 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 11 Sep 2012 00:56:56 +0000 Subject: [PATCH] gantt: code layout cleanup image_task method of lib/redmine/helpers/gantt.rb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10354 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/helpers/gantt.rb | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index cdec9d424..8187efe51 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -786,14 +786,23 @@ module Redmine # Renders the task bar, with progress and late if coords[:bar_start] && coords[:bar_end] params[:image].fill('#aaa') - params[:image].rectangle(params[:subject_width] + coords[:bar_start], params[:top], params[:subject_width] + coords[:bar_end], params[:top] - height) + params[:image].rectangle(params[:subject_width] + coords[:bar_start], + params[:top], + params[:subject_width] + coords[:bar_end], + params[:top] - height) if coords[:bar_late_end] params[:image].fill('#f66') - params[:image].rectangle(params[:subject_width] + coords[:bar_start], params[:top], params[:subject_width] + coords[:bar_late_end], params[:top] - height) + params[:image].rectangle(params[:subject_width] + coords[:bar_start], + params[:top], + params[:subject_width] + coords[:bar_late_end], + params[:top] - height) end if coords[:bar_progress_end] params[:image].fill('#00c600') - params[:image].rectangle(params[:subject_width] + coords[:bar_start], params[:top], params[:subject_width] + coords[:bar_progress_end], params[:top] - height) + params[:image].rectangle(params[:subject_width] + coords[:bar_start], + params[:top], + params[:subject_width] + coords[:bar_progress_end], + params[:top] - height) end end # Renders the markers @@ -802,19 +811,21 @@ module Redmine x = params[:subject_width] + coords[:start] y = params[:top] - height / 2 params[:image].fill('blue') - params[:image].polygon(x-4, y, x, y-4, x+4, y, x, y+4) + params[:image].polygon(x - 4, y, x, y - 4, x + 4, y, x, y + 4) end if coords[:end] x = params[:subject_width] + coords[:end] + params[:zoom] y = params[:top] - height / 2 params[:image].fill('blue') - params[:image].polygon(x-4, y, x, y-4, x+4, y, x, y+4) + params[:image].polygon(x - 4, y, x, y - 4, x + 4, y, x, y + 4) end end # Renders the label on the right if options[:label] params[:image].fill('black') - params[:image].text(params[:subject_width] + (coords[:bar_end] || 0) + 5,params[:top] + 1, options[:label]) + params[:image].text(params[:subject_width] + (coords[:bar_end] || 0) + 5, + params[:top] + 1, + options[:label]) end end end -- 2.39.5