导入模型是角色图形状间距缩小

This commit is contained in:
446052889@qq.com 2022-07-05 18:54:42 +08:00
parent 47beb09f48
commit 24947ddcb7
2 changed files with 5 additions and 5 deletions

View File

@ -1190,9 +1190,9 @@ public class ArisXmlImportRun {
for (int i = 0; i < elements.size(); i++) { for (int i = 0; i < elements.size(); i++) {
JSONObject shape = elements.getJSONObject(i); JSONObject shape = elements.getJSONObject(i);
count++; count++;
if (count % (shapeRowCount + 1) == 0) { if (count % (shapeRowCount+1) == 0) {
count = 1; count = 1;
initY += 130; initY += 90;
// 换行 // 换行
initX = 0; initX = 0;
initX = pageEdge + initX; initX = pageEdge + initX;
@ -1205,14 +1205,14 @@ public class ArisXmlImportRun {
} }
shape.put("dataAttributes", dataAttributes); shape.put("dataAttributes", dataAttributes);
} }
int totalWidth = 240;// 每个节点总宽度空白+节点+空白 int totalWidth = 160;// 每个节点总宽度空白+节点+空白
int totalHeight = 200;// 每个节点总高度空白+节点+空白 int totalHeight = 200;// 每个节点总高度空白+节点+空白
int x = 0; int x = 0;
int y = 0; int y = 0;
int w = validateJson(shape.getJSONObject("props").getInteger("w")); int w = validateJson(shape.getJSONObject("props").getInteger("w"));
int h = validateJson(shape.getJSONObject("props").getInteger("h")); int h = validateJson(shape.getJSONObject("props").getInteger("h"));
int leftBlankWidth = (totalWidth - w) / 2; int leftBlankWidth = (totalWidth - w)/2;
int topBlankHeight = (totalHeight - h) / 2; int topBlankHeight = (totalHeight - h)/2;
x = initX + leftBlankWidth; x = initX + leftBlankWidth;
initX = x + w + leftBlankWidth; initX = x + w + leftBlankWidth;
y = initY + topBlankHeight; y = initY + topBlankHeight;