From 2621139b2081d12f8b52d425371d4ebdcfed0880 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sun, 22 May 2022 12:22:28 +0200 Subject: [PATCH] wip --- .../plantuml/timingdiagram/PlayerBinary.java | 18 ++++++++++++------ .../sourceforge/plantuml/version/Version.java | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java b/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java index d142b41e3..fa3ddf3be 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java +++ b/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java @@ -172,21 +172,27 @@ public class PlayerBinary extends Player { List lastValues = initialState == null ? Collections.singletonList(LOW_STRING) : initialState.getStates(); final StringBounder stringBounder = ug.getStringBounder(); - final ULine vline = ULine.vline(getYlow(stringBounder) - getYhigh(stringBounder)); + final double yhigh = getYhigh(stringBounder); + final double ylow = getYlow(stringBounder); + final ULine vline = ULine.vline(ylow - yhigh); for (Map.Entry ent : values.entrySet()) { final ChangeState value = ent.getValue(); final double x = ruler.getPosInPixel(ent.getKey()); - ug.apply(new UTranslate(lastx, getYpos(stringBounder, lastValues.get(0)))) - .draw(ULine.hline(x - lastx)); + if (lastValues.size() == 1) + ug.apply(new UTranslate(lastx, getYpos(stringBounder, lastValues.get(0)))) + .draw(ULine.hline(x - lastx)); + else + for (double tmpx = lastx; tmpx < x; tmpx += 5) + ug.apply(new UTranslate(tmpx, yhigh)).draw(vline); + if (lastValues.equals(value.getStates()) == false) - ug.apply(new UTranslate(x, getYhigh(stringBounder))).draw(vline); + ug.apply(new UTranslate(x, yhigh)).draw(vline); if (value.getComment() != null) { final TextBlock label = getTextBlock(value.getComment()); - // final Dimension2D dim = label.calculateDimension(ug.getStringBounder()); - label.drawU(ug.apply(new UTranslate(x + 2, getYhigh(stringBounder)))); + label.drawU(ug.apply(new UTranslate(x + 2, yhigh))); } lastx = x; diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index 0da0720d6..7bafdfd8b 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -80,7 +80,7 @@ public class Version { } public static int beta() { - final int beta = 1; + final int beta = 2; return beta; }