1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 13:05:09 +00:00

fix: Gantt Layout issue when Print between is used with Printscale weekly

https://github.com/plantuml/plantuml/issues/1664
This commit is contained in:
Arnaud Roques 2024-02-01 18:52:57 +01:00
parent dbb535473c
commit 5fae97f44e
7 changed files with 16 additions and 16 deletions

View File

@ -307,15 +307,15 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
if (openClose.getStartingDay() == null) if (openClose.getStartingDay() == null)
return new TimeHeaderSimple(stringBounder, thParam(), printScale); return new TimeHeaderSimple(stringBounder, thParam(), printScale);
else if (printScale == PrintScale.DAILY) else if (printScale == PrintScale.DAILY)
return new TimeHeaderDaily(stringBounder, thParam(), nameDays, printStart, printEnd); return new TimeHeaderDaily(stringBounder, thParam(), nameDays, printStart);
else if (printScale == PrintScale.WEEKLY) else if (printScale == PrintScale.WEEKLY)
return new TimeHeaderWeekly(stringBounder, thParam(), weekNumberStrategy, withCalendarDate); return new TimeHeaderWeekly(stringBounder, thParam(), weekNumberStrategy, withCalendarDate, printStart);
else if (printScale == PrintScale.MONTHLY) else if (printScale == PrintScale.MONTHLY)
return new TimeHeaderMonthly(stringBounder, thParam()); return new TimeHeaderMonthly(stringBounder, thParam(), printStart);
else if (printScale == PrintScale.QUARTERLY) else if (printScale == PrintScale.QUARTERLY)
return new TimeHeaderQuarterly(stringBounder, thParam()); return new TimeHeaderQuarterly(stringBounder, thParam(), printStart);
else if (printScale == PrintScale.YEARLY) else if (printScale == PrintScale.YEARLY)
return new TimeHeaderYearly(stringBounder, thParam()); return new TimeHeaderYearly(stringBounder, thParam(), printStart);
else else
throw new IllegalStateException(); throw new IllegalStateException();

View File

@ -96,7 +96,7 @@ public class TimeHeaderDaily extends TimeHeaderCalendar {
private final Map<Day, String> nameDays; private final Map<Day, String> nameDays;
public TimeHeaderDaily(StringBounder stringBounder, TimeHeaderParameters thParam, Map<Day, String> nameDays, public TimeHeaderDaily(StringBounder stringBounder, TimeHeaderParameters thParam, Map<Day, String> nameDays,
Day printStart, Day printEnd) { Day printStart) {
super(thParam, new TimeScaleDaily(thParam.getCellWidth(stringBounder), thParam.getStartingDay(), super(thParam, new TimeScaleDaily(thParam.getCellWidth(stringBounder), thParam.getStartingDay(),
thParam.getScale(), printStart)); thParam.getScale(), printStart));
this.nameDays = nameDays; this.nameDays = nameDays;

View File

@ -67,9 +67,9 @@ public class TimeHeaderMonthly extends TimeHeaderCalendar {
return getTimeHeaderHeight(stringBounder); return getTimeHeaderHeight(stringBounder);
} }
public TimeHeaderMonthly(StringBounder stringBounder, TimeHeaderParameters thParam) { public TimeHeaderMonthly(StringBounder stringBounder, TimeHeaderParameters thParam, Day printStart) {
super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(), super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(),
thParam.getScale())); thParam.getScale(), printStart));
} }
@Override @Override

View File

@ -67,9 +67,9 @@ public class TimeHeaderQuarterly extends TimeHeaderCalendar {
return getTimeHeaderHeight(stringBounder); return getTimeHeaderHeight(stringBounder);
} }
public TimeHeaderQuarterly(StringBounder stringBounder, TimeHeaderParameters thParam) { public TimeHeaderQuarterly(StringBounder stringBounder, TimeHeaderParameters thParam, Day printStart) {
super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(), super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(),
thParam.getScale())); thParam.getScale(), printStart));
} }
@Override @Override

View File

@ -76,9 +76,9 @@ public class TimeHeaderWeekly extends TimeHeaderCalendar {
} }
public TimeHeaderWeekly(StringBounder stringBounder, TimeHeaderParameters thParam, public TimeHeaderWeekly(StringBounder stringBounder, TimeHeaderParameters thParam,
WeekNumberStrategy weekNumberStrategy, boolean withCalendarDate) { WeekNumberStrategy weekNumberStrategy, boolean withCalendarDate, Day printStart) {
super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(), super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(),
thParam.getScale())); thParam.getScale(), printStart));
this.weekNumberStrategy = weekNumberStrategy; this.weekNumberStrategy = weekNumberStrategy;
this.withCalendarDate = withCalendarDate; this.withCalendarDate = withCalendarDate;
} }

View File

@ -64,9 +64,9 @@ public class TimeHeaderYearly extends TimeHeaderCalendar {
return getTimeHeaderHeight(stringBounder); return getTimeHeaderHeight(stringBounder);
} }
public TimeHeaderYearly(StringBounder stringBounder, TimeHeaderParameters thParam) { public TimeHeaderYearly(StringBounder stringBounder, TimeHeaderParameters thParam, Day printStart) {
super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(), super(thParam, new TimeScaleCompressed(thParam.getCellWidth(stringBounder), thParam.getStartingDay(),
thParam.getScale())); thParam.getScale(), printStart));
} }
@Override @Override

View File

@ -42,8 +42,8 @@ public class TimeScaleCompressed implements TimeScale {
private final TimeScale daily; private final TimeScale daily;
public TimeScaleCompressed(double size, Day calendar, double scale) { public TimeScaleCompressed(double size, Day calendar, double scale, Day zeroDay) {
this.daily = new TimeScaleDaily(size, calendar, scale, null); this.daily = new TimeScaleDaily(size, calendar, scale, zeroDay);
} }
public double getStartingPosition(Day instant) { public double getStartingPosition(Day instant) {