1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 21:15:09 +00:00

Infer scale instead of storing it in ImageBuilder.

This commit is contained in:
matthew16550 2021-04-07 19:16:17 +10:00
parent 2b712e44c0
commit f47a2a14fc

View File

@ -120,7 +120,6 @@ public class ImageBuilder {
private ClockwiseTopRightBottomLeft margin = ClockwiseTopRightBottomLeft.none();
private String metadata;
private String preserveAspectRatio;
private Scale scale;
private long seed = 42;
private ISkinParam skinParam;
private int status = 0;
@ -228,7 +227,6 @@ public class ImageBuilder {
margin = calculateMargin(diagram);
metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null;
preserveAspectRatio = calculatePreserveAspectRatio(fileFormatOption, skinParam);
scale = diagram.getScale();
seed = diagram.seed();
svgDimensionStyle = skinParam.svgDimensionStyle();
svgLinkTarget = (fileFormatOption.getSvgLinkTarget() != null)
@ -277,6 +275,7 @@ public class ImageBuilder {
dx = -minmax.getMinX();
dy = -minmax.getMinY();
}
final Scale scale = titledDiagram == null ? null : titledDiagram.getScale();
final double scaleFactor = (scale == null ? 1 : scale.getScale(dim.getWidth(), dim.getHeight())) * getDpi() / 96.0;
final UGraphic2 ug = createUGraphic(fileFormatOption, dim, animationArg, dx, dy, scaleFactor);
UGraphic ug2 = ug;