1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-25 06:17:33 +00:00

Merge pull request #1489 from travkin79/patch/1467

Patch for #1467
This commit is contained in:
PlantUML 2023-07-24 16:16:24 +02:00 committed by GitHub
commit afada208c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 9 deletions

View File

@ -59,6 +59,7 @@ import net.sourceforge.plantuml.style.ISkinSimple;
import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.url.Url;
import net.sourceforge.plantuml.utils.Direction;
import net.sourceforge.plantuml.utils.LineLocation;
public class Link extends WithLinkType implements Hideable, Removeable {
@ -541,4 +542,11 @@ public class Link extends WithLinkType implements Hideable, Removeable {
return opale;
}
public final boolean hasKal1() {
return this.linkArg.getKal1() != null && !this.linkArg.getKal1().isEmpty();
}
public final boolean hasKal2() {
return this.linkArg.getKal2() != null && !this.linkArg.getKal2().isEmpty();
}
}

View File

@ -103,8 +103,8 @@ public class LinkArg {
}
public LinkArg getInv() {
return new LinkArg(label, length, quantifier2, quantifier1, labeldistance, labelangle, visibilityModifier, kal1,
kal2);
return new LinkArg(label, length, quantifier2, quantifier1, labeldistance, labelangle, visibilityModifier, kal2,
kal1);
}
public final Display getLabel() {

View File

@ -83,11 +83,11 @@ public class Kal implements UDrawable {
} else if (link.getEntity1() == entity) {
this.position = Direction.DOWN;
entity.ensureMargins(new Margins(0, 0, dim.getHeight(), 0));
entity.ensureMargins(new Margins(0, 0, 0, dim.getHeight()));
} else if (link.getEntity2() == entity) {
this.position = Direction.UP;
entity.ensureMargins(new Margins(0, 0, 0, dim.getHeight()));
entity.ensureMargins(new Margins(0, 0, dim.getHeight(),0 ));
} else {
throw new IllegalStateException();

View File

@ -5,12 +5,12 @@
* (C) Copyright 2009-2024, Arnaud Roques
*
* Project Info: https://plantuml.com
*
*
* If you like this project or if you find it useful, you can support us at:
*
*
* https://plantuml.com/patreon (only 1$ per month!)
* https://plantuml.com/paypal
*
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@ -31,7 +31,7 @@
*
* Original Author: Arnaud Roques
*
*
*
*/
package net.sourceforge.plantuml.svek;
@ -381,7 +381,18 @@ public class SvekNode implements Positionable, Hideable {
}
public boolean isShielded() {
return shield().isZero() == false;
if (this.shield != null) {
return this.shield.isZero() == false;
}
// Avoid calculating "shield" size through this.shield() before finishing creation of all SvekLines (#1467)
// Instead, only check if we will have a shield (size is irrelevant here)
// This node will have a shield if it is target of a qualified association (will have a qualifier label
// placed besides this type's bounding box.)
return this.leaf.getDiagram().getLinks().stream()
.filter(link -> link.getEntity1() == this.leaf || link.getEntity2() == this.leaf)
.anyMatch(link -> (this.leaf == link.getEntity1() && link.hasKal1())
|| (this.leaf == link.getEntity2() && link.hasKal2()));
}
public void resetMoveSvek() {