if (position == Position.LEFT) {
commands.add(new MoveTo(prevPoint.getX() + 1 + lineWidth, prevPoint.getY() + 0.5 - lineWidth));
commands.add(new LineTo(prevPoint.getX() + 1 + width - lineWidth, prevPoint.getY() + 0.5 - lineWidth));
commands.add(new LineTo(point.getX() + 1 + width - lineWidth, point.getY() + 0.5 + lineWidth));
commands.add(new LineTo(point.getX() + 1 + lineWidth, point.getY() + 0.5 + lineWidth));
commands.add(new ClosePath());
} else if (position == Position.RIGHT) {
commands.add(new MoveTo(prevPoint.getX() - lineWidth, prevPoint.getY() + 0.5 - lineWidth));
commands.add(new LineTo(prevPoint.getX() - width + lineWidth, prevPoint.getY() + 0.5 - lineWidth));
commands.add(new LineTo(point.getX() - width + lineWidth, point.getY() + 0.5 + lineWidth));
commands.add(new LineTo(point.getX() - lineWidth, point.getY() + 0.5 + lineWidth));
commands.add(new ClosePath());
} else if (position == Position.TOP) {
commands.add(new MoveTo(prevPoint.getX() + 0.5 + lineWidth, prevPoint.getY() + 0.5 - lineWidth));
commands.add(new LineTo(prevPoint.getX() + 0.5 + lineWidth, prevPoint.getY() + 1 + width - lineWidth));
commands.add(new LineTo(point.getX() + 0.5 - lineWidth, point.getY() + 1 + width - lineWidth));
commands.add(new LineTo(point.getX() + 0.5 - lineWidth, point.getY() + 1 + lineWidth));
commands.add(new ClosePath());
} else {
commands.add(new MoveTo(prevPoint.getX() + 0.5 + lineWidth, prevPoint.getY() + 1 + lineWidth));
commands.add(new LineTo(prevPoint.getX() + 0.5 + lineWidth, prevPoint.getY() - width + lineWidth));
commands.add(new LineTo(point.getX() + 0.5 - lineWidth, point.getY() - width + lineWidth));
commands.add(new LineTo(point.getX() + 0.5 - lineWidth, point.getY() - lineWidth));
commands.add(new ClosePath());
}
} else if (defaultGridConfig != null) {
if (position == Position.LEFT) {
commands.add(new MoveTo(point.getX() + 0.5, point.getY() + 0.5));
commands.add(new LineTo(width, 0, true));