diff --git a/src/net/sourceforge/plantuml/FileFormatOption.java b/src/net/sourceforge/plantuml/FileFormatOption.java index b90939a1f..b21683597 100644 --- a/src/net/sourceforge/plantuml/FileFormatOption.java +++ b/src/net/sourceforge/plantuml/FileFormatOption.java @@ -65,11 +65,11 @@ public final class FileFormatOption implements Serializable { } public FileFormatOption(FileFormat fileFormat) { - this(fileFormat, null, true, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0, "none", null); + this(fileFormat, null, true, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null); } public FileFormatOption(FileFormat fileFormat, boolean withMetadata) { - this(fileFormat, null, withMetadata, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0, "none", + this(fileFormat, null, withMetadata, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null); } diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java index 2567b5ee0..b71f8f4ba 100644 --- a/src/net/sourceforge/plantuml/UmlDiagram.java +++ b/src/net/sourceforge/plantuml/UmlDiagram.java @@ -134,10 +134,6 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot final protected ImageData exportDiagramNow(OutputStream os, int index, FileFormatOption fileFormatOption) throws IOException { - if (fileFormatOption.getSvgLinkTarget() == null || fileFormatOption.getSvgLinkTarget().equals("_top")) { - fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget()); - } - fileFormatOption = fileFormatOption.withPreserveAspectRatio(getSkinParam().getPreserveAspectRatio()); fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion()); if (fileFormatOption.getFileFormat() == FileFormat.PDF) { diff --git a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java index a867d640b..cf89f29b1 100644 --- a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java +++ b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java @@ -123,11 +123,13 @@ public class ImageBuilder { private UDrawable udrawable; private ClockwiseTopRightBottomLeft margin = ClockwiseTopRightBottomLeft.none(); private String metadata; + private String preserveAspectRatio; private Scale scale; private long seed = 42; private int status = 0; private SvgCharSizeHack svgCharSizeHack = SvgCharSizeHack.NO_HACK; private boolean svgDimensionStyle = true; + private String svgLinkTarget; private TitledDiagram titledDiagram; private boolean randomPixel; private String warningOrError; @@ -220,10 +222,14 @@ public class ImageBuilder { lengthAdjust = skinParam.getlengthAdjust(); margin = calculateMargin(diagram); metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null; + preserveAspectRatio = (fileFormatOption.getPreserveAspectRatio() != null) + ? fileFormatOption.getPreserveAspectRatio() : skinParam.getPreserveAspectRatio(); scale = diagram.getScale(); seed = diagram.seed(); svgCharSizeHack = skinParam; svgDimensionStyle = skinParam.svgDimensionStyle(); + svgLinkTarget = (fileFormatOption.getSvgLinkTarget() != null) + ? fileFormatOption.getSvgLinkTarget() : skinParam.getSvgLinkTarget(); titledDiagram = diagram; warningOrError = diagram.getWarningOrError(); return this; @@ -399,8 +405,7 @@ public class ImageBuilder { return createUGraphicPNG(scaleFactor, dim, animationArg, dx, dy, option.getWatermark()); case SVG: - return createUGraphicSVG(scaleFactor, dim, option.getSvgLinkTarget(), - option.getPreserveAspectRatio()); + return createUGraphicSVG(scaleFactor, dim); case EPS: return new UGraphicEps(colorMapper, EpsStrategy.getDefault2()); case EPS_TEXT: @@ -425,8 +430,7 @@ public class ImageBuilder { } } - private UGraphic2 createUGraphicSVG(double scaleFactor, Dimension2D dim, - String svgLinkTarget, String preserveAspectRatio) { + private UGraphic2 createUGraphicSVG(double scaleFactor, Dimension2D dim) { HColor backColor = HColorUtils.WHITE; // TODO simplify backcolor some more in a future PR if (this.backcolor instanceof HColorSimple) { backColor = this.backcolor;