mirror of
https://github.com/octoleo/plantuml.git
synced 2025-04-07 02:31:51 +00:00
Fix arrow constraint position
This commit is contained in:
parent
9383a24be7
commit
5fb770cb57
@ -76,6 +76,10 @@ public class TimeConstraint {
|
|||||||
this.styleBuilder = skinParam.getCurrentStyleBuilder();
|
this.styleBuilder = skinParam.getCurrentStyleBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean containsStrict(TimeTick other) {
|
||||||
|
return tick1.compareTo(other) < 0 && tick2.compareTo(other) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
public final TimeTick getTick1() {
|
public final TimeTick getTick1() {
|
||||||
return tick1;
|
return tick1;
|
||||||
}
|
}
|
||||||
|
@ -347,18 +347,16 @@ public class Histogram implements PDrawing {
|
|||||||
|
|
||||||
private void drawConstraints(UGraphic ug) {
|
private void drawConstraints(UGraphic ug) {
|
||||||
for (TimeConstraint constraint : constraints) {
|
for (TimeConstraint constraint : constraints) {
|
||||||
final String state1 = last(getStatesAt(constraint.getTick1()));
|
double y = yOfState(constraint.getTick1());
|
||||||
final String state2 = getStatesAt(constraint.getTick2()).get(0);
|
for (ChangeState change : changes) {
|
||||||
final double y1 = yOfState(state1);
|
if (constraint.containsStrict(change.getWhen())) {
|
||||||
final double y2 = yOfState(state2);
|
y = Math.min(y, yOfState(change.getWhen()));
|
||||||
constraint.drawU(ug.apply(UTranslate.dy(y1)), ruler);
|
}
|
||||||
|
}
|
||||||
|
constraint.drawU(ug.apply(UTranslate.dy(y)), ruler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String last(List<String> list) {
|
|
||||||
return list.get(list.size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Point2D.Double getInitialPoint() {
|
private Point2D.Double getInitialPoint() {
|
||||||
return new Point2D.Double(-getInitialWidth(), yOfState(initialState));
|
return new Point2D.Double(-getInitialWidth(), yOfState(initialState));
|
||||||
}
|
}
|
||||||
@ -380,6 +378,14 @@ public class Histogram implements PDrawing {
|
|||||||
return stepHeight() * nb;
|
return stepHeight() * nb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double yOfState(TimeTick when) {
|
||||||
|
return yOfState(last(getStatesAt(when)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String last(List<String> list) {
|
||||||
|
return list.get(list.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
private double stepHeight() {
|
private double stepHeight() {
|
||||||
if (suggestedHeight == 0 || allStates.size() <= 1) {
|
if (suggestedHeight == 0 || allStates.size() <= 1) {
|
||||||
return 20;
|
return 20;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user