Bug #1354: Fix bug
Although the constraint is not applied it must be provided. Otherwise the dominating forces would not take it into account. Normally this wasn't a problem since if the secondary point date changes it was provided. But it can happen that the secondary point doesn't change, in that case the constraint must still be taken into account.
This commit is contained in:
parent
d91016f532
commit
93d5667769
1 changed files with 14 additions and 11 deletions
|
|
@ -1746,15 +1746,17 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
|||
.withConstraints(restrictions.getStartConstraints())
|
||||
.withConstraints(getStartConstraints())
|
||||
.applyWithoutFinalCheck();
|
||||
if (result != null && !result.equals(getStartDate(task))) {
|
||||
return enforceRestrictions(result);
|
||||
if (result != null) {
|
||||
enforceRestrictions(result);
|
||||
return biggerThan(result, adapter.getEndDateFor(task));
|
||||
}
|
||||
return restrictions;
|
||||
}
|
||||
|
||||
private PositionRestrictions enforceRestrictions(GanttDate result) {
|
||||
adapter.setStartDateFor(task, result);
|
||||
return biggerThan(result, adapter.getEndDateFor(task));
|
||||
private void enforceRestrictions(GanttDate result) {
|
||||
if (!result.equals(getStartDate(task))) {
|
||||
adapter.setStartDateFor(task, result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1768,8 +1770,9 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
|||
.withConstraints(restrictions.getEndConstraints())
|
||||
.withConstraints(getEndConstraints())
|
||||
.applyWithoutFinalCheck();
|
||||
if (result != null && !result.equals(getEndDateFor(task))) {
|
||||
return enforceRestrictions(result);
|
||||
if (result != null) {
|
||||
enforceRestrictions(result);
|
||||
return lessThan(adapter.getStartDate(task), result);
|
||||
}
|
||||
return restrictions;
|
||||
}
|
||||
|
|
@ -1784,11 +1787,11 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
|||
return adapter.getEndConstraintsFor(task);
|
||||
}
|
||||
|
||||
private PositionRestrictions enforceRestrictions(GanttDate newEnd) {
|
||||
adapter.setEndDateFor(task, newEnd);
|
||||
return lessThan(adapter.getStartDate(task), newEnd);
|
||||
private void enforceRestrictions(GanttDate newEnd) {
|
||||
if (!newEnd.equals(getEndDateFor(task))) {
|
||||
adapter.setEndDateFor(task, newEnd);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue