Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroques committed Apr 7, 2022
1 parent 29cd7dc commit d8c80f4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
17 changes: 10 additions & 7 deletions src/net/sourceforge/plantuml/graphic/FontConfiguration.java
Expand Up @@ -70,14 +70,15 @@ public String toStringDebug() {
return getFont().toStringDebug() + " " + styles.toString();
}

public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor, boolean useUnderlineForHyperlink) {
public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor,
boolean useUnderlineForHyperlink) {
return create(font, color, hyperlinkColor, useUnderlineForHyperlink, 8);
}

public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor, boolean useUnderlineForHyperlink,
int tabSize) {
return new FontConfiguration(getStyles(font), font, color, font, color, null, FontPosition.NORMAL, new SvgAttributes(), false,
hyperlinkColor, useUnderlineForHyperlink, tabSize);
public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor,
boolean useUnderlineForHyperlink, int tabSize) {
return new FontConfiguration(getStyles(font), font, color, font, color, null, FontPosition.NORMAL,
new SvgAttributes(), false, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}

public static FontConfiguration blackBlueTrue(UFont font) {
Expand All @@ -91,10 +92,12 @@ public static FontConfiguration create(ISkinParam skinParam, FontParam fontParam
}

public static FontConfiguration create(ISkinParam skinParam, Style style) {
// User getStyle().getFontConfiguration(skinParam.getIHtmlColorSet()) instead ?
final HColor hyperlinkColor = style.value(PName.HyperLinkColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
final boolean useUnderlineForHyperlink = skinParam.useUnderlineForHyperlink();
return create(style.getUFont(),
style.value(PName.FontColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()),
skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
hyperlinkColor, useUnderlineForHyperlink, skinParam.getTabSize());
}

// ---
Expand Down
23 changes: 12 additions & 11 deletions src/net/sourceforge/plantuml/svek/SvekLine.java
Expand Up @@ -625,6 +625,14 @@ public void drawU(UGraphic ug, UStroke suggestedStroke, HColor color, Set<String
if (opale)
return;

if (link.isInvis())
return;

if (dotPath == null) {
Log.info("DotPath is null for " + this);
return;
}

ug.draw(link.commentForSvg());
final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS,
Expand All @@ -648,9 +656,6 @@ public void drawU(UGraphic ug, UStroke suggestedStroke, HColor color, Set<String
x += dx;
y += dy;

if (link.isInvis())
return;

if (this.link.getColors() != null) {
final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE);
if (newColor != null)
Expand All @@ -669,10 +674,6 @@ public void drawU(UGraphic ug, UStroke suggestedStroke, HColor color, Set<String
ug = ug.apply(stroke);
// double moveEndY = 0;

if (dotPath == null) {
Log.info("DotPath is null for " + this);
return;
}
DotPath todraw = dotPath;
if (link.getEntity2().isGroup() && link.getEntity2().getUSymbol() instanceof USymbolFolder) {
final Cluster endCluster = bibliotekon.getCluster((IGroup) link.getEntity2());
Expand Down Expand Up @@ -738,15 +739,15 @@ public void drawU(UGraphic ug, UStroke suggestedStroke, HColor color, Set<String
final Set<Point2D> bez = dotPath.sample();
Point2D minPt = null;
double minDist = Double.MAX_VALUE;
for (Point2D pt : square) {
for (Point2D pt : square)
for (Point2D pt2 : bez) {
final double distance = pt2.distance(pt);
if (minPt == null || distance < minDist) {
minPt = pt;
minDist = distance;
}
}
}

link.getLinkConstraint().setPosition(link, minPt);
link.getLinkConstraint().drawMe(ug, skinParam);
}
Expand All @@ -769,9 +770,9 @@ private List<Point2D> getSquare(double x, double y) {

private String uniq(final Set<String> ids, final String comment) {
boolean changed = ids.add(comment);
if (changed) {
if (changed)
return comment;
}

int i = 1;
while (true) {
final String candidate = comment + "-" + i;
Expand Down
2 changes: 1 addition & 1 deletion src/net/sourceforge/plantuml/version/Version.java
Expand Up @@ -80,7 +80,7 @@ public static String versionString(int size) {
}

public static int beta() {
final int beta = 1;
final int beta = 2;
return beta;
}

Expand Down

1 comment on commit d8c80f4

@The-Lum
Copy link
Collaborator

@The-Lum The-Lum commented on d8c80f4 Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for traceability, this commit fixes #436.

Please sign in to comment.