From c1bbdd6ade4736f931ceedb3ab66c7a72d9ffd7a Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Tue, 17 Jan 2023 19:19:39 +0100 Subject: [PATCH] Partially fix https://github.com/plantuml/plantuml/issues/1266 --- .../plantuml/tikz/TikzGraphics.java | 33 ++++++++++++++----- .../sourceforge/plantuml/version/Version.java | 2 +- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java index c40f6d042..80ea71db6 100644 --- a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java +++ b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java @@ -546,15 +546,32 @@ public class TikzGraphics { final double newx = coord[5] + x; final double newy = coord[6] + y; + final boolean easyCase = coord[2] == 0 && coord[3] == 0 && coord[4] == 1; -// if (newx > lastx && newy < lasty) { -// final int start = 180; -// final int end = 270; -// final String radius = format(coord[0]); -// sb.append(" arc(" + start + ":" + end + ":" + radius + "pt) "); -// } - sb.append(" -- "); - sb.append(couple(coord[5] + x, coord[6] + y)); + if (easyCase && newx > lastx && newy < lasty) { + final int start = 180; + final int end = 270; + final String radius = format(coord[0]); + sb.append(" arc(" + start + ":" + end + ":" + radius + "pt) "); + } else if (easyCase && newx > lastx && newy > lasty) { + final int start = 270; + final int end = 360; + final String radius = format(coord[0]); + sb.append(" arc(" + start + ":" + end + ":" + radius + "pt) "); + } else if (easyCase && newx < lastx && newy > lasty) { + final int start = 0; + final int end = 90; + final String radius = format(coord[0]); + sb.append(" arc(" + start + ":" + end + ":" + radius + "pt) "); + } else if (easyCase && newx < lastx && newy < lasty) { + final int start = 90; + final int end = 180; + final String radius = format(coord[0]); + sb.append(" arc(" + start + ":" + end + ":" + radius + "pt) "); + } else { + sb.append(" -- "); + sb.append(couple(coord[5] + x, coord[6] + y)); + } lastx = newx; lasty = newy; diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index 14232d20e..3e9489baa 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -81,7 +81,7 @@ public class Version { } public static int beta() { - final int beta = 4; + final int beta = 5; return beta; }