From 848a75216f2563f5623c9326051579328bc4d4da Mon Sep 17 00:00:00 2001 From: matthew16550 Date: Sat, 20 Mar 2021 02:51:26 +1100 Subject: [PATCH] Fix previous regression a different way that fixes a use case the previous fix missed. --- .../plantuml/activitydiagram/ActivityDiagram.java | 6 ------ .../sourceforge/plantuml/classdiagram/ClassDiagram.java | 6 ------ src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java | 7 +++++++ .../plantuml/descdiagram/DescriptionDiagram.java | 6 ------ .../sourceforge/plantuml/statediagram/StateDiagram.java | 6 ------ .../plantuml/svek/CucaDiagramFileMakerSvek.java | 1 + 6 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java index 5564c8b38..922a20389 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java +++ b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java @@ -52,7 +52,6 @@ import net.sourceforge.plantuml.cucadiagram.Ident; import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy; import net.sourceforge.plantuml.graphic.USymbol; -import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.utils.UniqueSequence; public class ActivityDiagram extends CucaDiagram { @@ -207,9 +206,4 @@ public class ActivityDiagram extends CucaDiagram { lastEntityBrancheConsulted = null; } - @Override - public ClockwiseTopRightBottomLeft getDefaultMargins() { - // Strange numbers here for backwards compatibility - return ClockwiseTopRightBottomLeft.topRightBottomLeft(-1, 5, 5, 6); - } } diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java index 7bcc68f64..26145a015 100644 --- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java +++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java @@ -55,7 +55,6 @@ import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram; -import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.svek.image.EntityImageClass; import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageParameter; @@ -235,9 +234,4 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram { return super.checkFinalError(); } - @Override - public ClockwiseTopRightBottomLeft getDefaultMargins() { - // Strange numbers here for backwards compatibility - return ClockwiseTopRightBottomLeft.topRightBottomLeft(-1, 5, 5, 7); - } } diff --git a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java index 1950c08bc..ef71ecf5a 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java +++ b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java @@ -62,6 +62,7 @@ import net.sourceforge.plantuml.sdot.CucaDiagramFileMakerSmetana; import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.statediagram.StateDiagram; +import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.svek.CucaDiagramFileMaker; import net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; @@ -918,4 +919,10 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy, link2.setLinkConstraint(linkConstraint); return CommandExecutionResult.ok(); } + + @Override + public ClockwiseTopRightBottomLeft getDefaultMargins() { + // Strange numbers here for backwards compatibility + return ClockwiseTopRightBottomLeft.topRightBottomLeft(0, 5, 5, 0); + } } diff --git a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java index 0b2c27da6..f9475f900 100644 --- a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java +++ b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java @@ -44,7 +44,6 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf; import net.sourceforge.plantuml.cucadiagram.Ident; import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.graphic.USymbol; -import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; public class DescriptionDiagram extends AbstractEntityDiagram { @@ -128,9 +127,4 @@ public class DescriptionDiagram extends AbstractEntityDiagram { return super.checkFinalError(); } - @Override - public ClockwiseTopRightBottomLeft getDefaultMargins() { - // Strange numbers here for backwards compatibility - return ClockwiseTopRightBottomLeft.topRightBottomLeft(-1, 5, 5, 7); - } } diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java index 38bf5980c..5a745310d 100644 --- a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java +++ b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java @@ -50,7 +50,6 @@ import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy; import net.sourceforge.plantuml.graphic.USymbol; -import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.utils.UniqueSequence; public class StateDiagram extends AbstractEntityDiagram { @@ -308,9 +307,4 @@ public class StateDiagram extends AbstractEntityDiagram { } - @Override - public ClockwiseTopRightBottomLeft getDefaultMargins() { - // Strange numbers here for backwards compatibility - return ClockwiseTopRightBottomLeft.topRightBottomLeft(-2, 5, 5, 7); - } } diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java index cb2ba05fa..f8ff9fedc 100644 --- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java +++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java @@ -117,6 +117,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker { if (widthwarning != null && widthwarning.matches("\\d+")) { warningOrError = svek2.getWarningOrError(Integer.parseInt(widthwarning)); } + result.calculateDimension(stringBounder); // Ensure text near the margins is not cut off final HColor backcolor = result.getBackcolor(); final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null;