Changed #1913 SVG export/import of shapes - shape exact position (bounds) is retained

This commit is contained in:
Jindra Petřík
2022-12-31 23:58:51 +01:00
parent 4f5fc62adc
commit e18575f2cd
20 changed files with 120 additions and 47 deletions
@@ -154,7 +154,7 @@ public class IggyToSwfConvertor {
SHAPE shp;
if (glyph != null) {
shp = IggyShapeToSwfConvertor.convertCharToShape(glyph);
fontTag.fontBoundsTable.add(shp.getBounds());
fontTag.fontBoundsTable.add(shp.getBounds(1));
} else {
shp = new SHAPE();
shp.shapeRecords = new ArrayList<>();
@@ -37,12 +37,12 @@ public class SwfShapeToIggyConvertor {
return (val / 1024f);
}
public static IggyShape convertShape(SHAPE swfShape) {
public static IggyShape convertShape(int shapeNum, SHAPE swfShape) {
/*if (swfShape.shapeRecords.size() == 1) { //no glyphs, maybe space
return null;
}*/
List<IggyShapeNode> nodes = new ArrayList<>();
RECT bounds = swfShape.getBounds();
RECT bounds = swfShape.getBounds(shapeNum);
boolean first = true;
float curX = 0f;
float curY = 0f;
@@ -126,7 +126,7 @@ public class SwfToIggyConvertor {
List<IggyShape> glyphs = new ArrayList<>();
for (SHAPE s : fontTag.glyphShapeTable) {
glyphs.add(SwfShapeToIggyConvertor.convertShape(s));
glyphs.add(SwfShapeToIggyConvertor.convertShape(1, s));
}
List<Character> chars = new ArrayList<>();