20 package net.sf.gridarta.gui.dialog.shrinkmapsize;
24 import org.jetbrains.annotations.NotNull;
54 final Size2D mapSize = mapModel.getMapArchObject().getMapSize();
55 int filledWidth = mapSize.
getWidth();
58 while (filledWidth > 1 && mapModel.isAreaEmpty(filledWidth - 1, 0, 1, filledHeight)) {
63 while (filledHeight > 1 && mapModel.isAreaEmpty(0, filledHeight - 1, filledWidth, 1)) {
67 mapModel.beginTransaction(
"Shrink Map Size");
69 mapModel.getMapArchObject().setMapSize(
new Size2D(filledWidth, filledHeight));
71 mapModel.endTransaction();
81 final Size2D mapSize = mapModel.getMapArchObject().getMapSize();
82 final int mapWidth = mapSize.
getWidth();
83 final int mapHeight = mapSize.
getHeight();
90 if (mapModel.isAreaEmpty(mapWidth - 1, 0, 1, mapHeight)) {
93 if (mapModel.isAreaEmpty(0, mapHeight - 1, mapWidth, 1)) {