From 55434b6f53f1635bc6f8f717aebd0da2facb3cdc Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Mon, 18 Jun 2018 20:47:51 -0500 Subject: [PATCH] Using spaces to show unused area in shape. --- .../api/shapes/exporters/TextShapeExporter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/io/github/applecommander/bastools/api/shapes/exporters/TextShapeExporter.java b/api/src/main/java/io/github/applecommander/bastools/api/shapes/exporters/TextShapeExporter.java index 7fcb91d..a4727a5 100644 --- a/api/src/main/java/io/github/applecommander/bastools/api/shapes/exporters/TextShapeExporter.java +++ b/api/src/main/java/io/github/applecommander/bastools/api/shapes/exporters/TextShapeExporter.java @@ -113,11 +113,15 @@ public class TextShapeExporter implements ShapeExporter { private void drawRowLine(PrintWriter pw, BitmapShape bshape, int width, int y) { List row = bshape.grid.size() > y ? bshape.grid.get(y) : new ArrayList<>(); for (int x=0; x x ? row.get(x) : Boolean.FALSE; - if (bshape.origin.x == x && bshape.origin.y == y) { - pw.printf("%c", plot ? '*' : '+'); + if (row.size() > x) { + Boolean plot = row.get(x); + if (bshape.origin.x == x && bshape.origin.y == y) { + pw.printf("%c", plot ? '*' : '+'); + } else { + pw.printf("%c", plot ? 'X' : '.'); + } } else { - pw.printf("%c", plot ? 'X' : '.'); + pw.print(" "); } } }