better board coordinate placement

This commit is contained in:
Branislav Stojkovic
2019-01-18 11:00:54 +01:00
parent dd06195035
commit a8f5155acd
4 changed files with 8 additions and 6 deletions
Binary file not shown.
@@ -93,17 +93,19 @@ public abstract class AbstractBoard extends AbstractTransparentComponent<String>
int t = 1; int t = 1;
while (p.y < secondPoint.y - spacing) { while (p.y < secondPoint.y - spacing) {
p.y += spacing; p.y += spacing;
super.drawCenteredText(g2d, ct == CoordinateType.XY ? getCoordinateLabel(t++) : Integer.toString(t++), p.x + 2, p.y, HorizontalAlignment.LEFT, super.drawCenteredText(g2d, ct == CoordinateType.XY ? getCoordinateLabel(t) : Integer.toString(t), p.x + (ct == CoordinateType.YX && t >= 10 ? 0 : 2), p.y, HorizontalAlignment.LEFT,
VerticalAlignment.CENTER); VerticalAlignment.CENTER);
t++;
} }
p = new Point(firstPoint); p = new Point(firstPoint);
t = 1; t = 1;
while (p.x < secondPoint.x - spacing) { while (p.x < secondPoint.x - spacing) {
p.x += spacing; p.x += spacing;
super.drawCenteredText(g2d, ct == CoordinateType.XY ? Integer.toString(t++) : getCoordinateLabel(t++), p.x, p.y - 2, HorizontalAlignment.CENTER, super.drawCenteredText(g2d, ct == CoordinateType.XY ? Integer.toString(t) : getCoordinateLabel(t), p.x, p.y - 2, HorizontalAlignment.CENTER,
VerticalAlignment.TOP); VerticalAlignment.TOP);
t++;
} }
} }
Binary file not shown.
Binary file not shown.