#1156 SVG Export - 9 slice scaling (DefineScalingGrid)

This commit is contained in:
Jindra Petřík
2021-03-12 22:12:39 +01:00
parent b85d22d9c5
commit 004e2ecdfd
4 changed files with 195 additions and 9 deletions
@@ -1055,19 +1055,21 @@ public class Timeline {
}
ExportRectangle rect = new ExportRectangle(boundRect);
DefineScalingGridTag scalingGrid = character.getScalingGridTag();
// TODO: if (layer.filters != null)
// TODO: if (layer.blendMode > 1)
// TODO: if (layer.blendMode > 1)
if (layer.clipDepth > -1) {
String clipName = exporter.getUniqueId("clipPath");
exporter.createClipPath(new Matrix(), clipName);
SvgClip clip = new SvgClip(clipName, layer.clipDepth);
clips.add(clip);
Matrix mat = Matrix.getTranslateInstance(rect.xMin, rect.yMin).preConcatenate(new Matrix(layer.matrix));
exporter.addUse(mat, boundRect, assetName, layer.instanceName);
exporter.addUse(mat, boundRect, assetName, layer.instanceName, scalingGrid == null ? null : scalingGrid.splitter);
exporter.endGroup();
} else {
Matrix mat = Matrix.getTranslateInstance(rect.xMin, rect.yMin).preConcatenate(new Matrix(layer.matrix));
exporter.addUse(mat, boundRect, assetName, layer.instanceName);
exporter.addUse(mat, boundRect, assetName, layer.instanceName, scalingGrid == null ? null : scalingGrid.splitter);
}
}
}