[Bug #1237] Fix problem with progress bar size

Now it takes into account the decimals when calculating the date for the
progress bar position.

FEA: ItEr75S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2011-11-08 17:51:18 +01:00
parent 3c3ba781a7
commit 16acbd51b6

View file

@ -638,10 +638,21 @@ public class TaskElementAdapter {
if (daysBetween == 0) {
return calculateLimitDateWhenDaysBetweenAreZero(advancePercentage);
}
int daysAdvance = advancePercentage.multiply(
new BigDecimal(daysBetween)).intValue();
return GanttDate.createFrom(taskElement.getIntraDayStartDate()
.getDate().plusDays(daysAdvance));
BigDecimal daysAdvance = advancePercentage
.multiply(new BigDecimal(daysBetween));
int days = daysAdvance.intValue();
LocalDate advanceDate = taskElement.getStartAsLocalDate()
.plusDays(days);
EffortDuration capacity = calendar.getCapacityOn(PartialDay
.wholeDay(advanceDate));
int seconds = daysAdvance.subtract(new BigDecimal(days))
.multiply(new BigDecimal(capacity.getSeconds()))
.intValue();
return toGantt(IntraDayDate.create(advanceDate,
EffortDuration.seconds(seconds)));
}
private GanttDate calculateLimitDateWhenDaysBetweenAreZero(