1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-12 16:36:28 +00:00

Merge pull request #496 from matthew16550/regression-again

Fix default margin regression a different way (replaces #495)
This commit is contained in:
arnaudroques 2021-03-19 17:05:35 +01:00 committed by GitHub
commit 0e0f7ef258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 24 deletions

View File

@ -52,7 +52,6 @@ import net.sourceforge.plantuml.cucadiagram.Ident;
import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy; import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.utils.UniqueSequence; import net.sourceforge.plantuml.utils.UniqueSequence;
public class ActivityDiagram extends CucaDiagram { public class ActivityDiagram extends CucaDiagram {
@ -207,9 +206,4 @@ public class ActivityDiagram extends CucaDiagram {
lastEntityBrancheConsulted = null; lastEntityBrancheConsulted = null;
} }
@Override
public ClockwiseTopRightBottomLeft getDefaultMargins() {
// Strange numbers here for backwards compatibility
return ClockwiseTopRightBottomLeft.topRightBottomLeft(-1, 5, 5, 6);
}
} }

View File

@ -55,7 +55,6 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram; import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.svek.image.EntityImageClass; import net.sourceforge.plantuml.svek.image.EntityImageClass;
import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.ImageParameter; import net.sourceforge.plantuml.ugraphic.ImageParameter;
@ -235,9 +234,4 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
return super.checkFinalError(); return super.checkFinalError();
} }
@Override
public ClockwiseTopRightBottomLeft getDefaultMargins() {
// Strange numbers here for backwards compatibility
return ClockwiseTopRightBottomLeft.topRightBottomLeft(-1, 5, 5, 7);
}
} }

View File

@ -62,6 +62,7 @@ import net.sourceforge.plantuml.sdot.CucaDiagramFileMakerSmetana;
import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.security.SecurityUtils;
import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.statediagram.StateDiagram; import net.sourceforge.plantuml.statediagram.StateDiagram;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.svek.CucaDiagramFileMaker; import net.sourceforge.plantuml.svek.CucaDiagramFileMaker;
import net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek; import net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek;
import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
@ -918,4 +919,10 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
link2.setLinkConstraint(linkConstraint); link2.setLinkConstraint(linkConstraint);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
@Override
public ClockwiseTopRightBottomLeft getDefaultMargins() {
// Strange numbers here for backwards compatibility
return ClockwiseTopRightBottomLeft.topRightBottomLeft(0, 5, 5, 0);
}
} }

View File

@ -44,7 +44,6 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Ident; import net.sourceforge.plantuml.cucadiagram.Ident;
import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
public class DescriptionDiagram extends AbstractEntityDiagram { public class DescriptionDiagram extends AbstractEntityDiagram {
@ -128,9 +127,4 @@ public class DescriptionDiagram extends AbstractEntityDiagram {
return super.checkFinalError(); return super.checkFinalError();
} }
@Override
public ClockwiseTopRightBottomLeft getDefaultMargins() {
// Strange numbers here for backwards compatibility
return ClockwiseTopRightBottomLeft.topRightBottomLeft(-1, 5, 5, 7);
}
} }

View File

@ -50,7 +50,6 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy; import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.utils.UniqueSequence; import net.sourceforge.plantuml.utils.UniqueSequence;
public class StateDiagram extends AbstractEntityDiagram { 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);
}
} }

View File

@ -117,6 +117,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker {
if (widthwarning != null && widthwarning.matches("\\d+")) { if (widthwarning != null && widthwarning.matches("\\d+")) {
warningOrError = svek2.getWarningOrError(Integer.parseInt(widthwarning)); warningOrError = svek2.getWarningOrError(Integer.parseInt(widthwarning));
} }
result.calculateDimension(stringBounder); // Ensure text near the margins is not cut off
final HColor backcolor = result.getBackcolor(); final HColor backcolor = result.getBackcolor();
final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null; final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null;