you can draw outside the edges

here is a function i use to draw an edge around the outside of a generated tilemap

first tile i place is at -1, -1

```
func _drawEdge() -> void:
var minY := rect.position.y - 1
var maxY := rect.end.y
var minX := rect.position.x - 1
var maxX := rect.end.x
for y in range(minY, maxY + 1):
for x in range(minX, maxX + 1):
if x == minX or x == maxX or y == minY or y == maxY:
if x == minX and y == minY: # nw
_edge.set_cell(x, y, Tile.EdgeOutsideCorner, false, false, false, Vector2(1, 0))
elif x == minX and y == maxY: # sw
_edge.set_cell(x, y, Tile.EdgeOutsideCorner, false, false, false, Vector2(2, 0))
elif x == maxX and y == minY: # ne
_edge.set_cell(x, y, Tile.EdgeOutsideCorner, false, false, false, Vector2(0, 0))
elif x == maxX and y == maxY: # se
_edge.set_cell(x, y, Tile.EdgeOutsideCorner, false, false, false, Vector2(3, 0))
elif x == minX: # w
_setRandomTile(_edge, x, y, Tile.EdgeOutside, false, Random.nextBool(), true)
elif x == maxX: # e
_setRandomTile(_edge, x, y, Tile.EdgeOutside, true, Random.nextBool(), true)
elif y == minY: # n
_setRandomTile(_edge, x, y, Tile.EdgeOutside, Random.nextBool(), false, false)
elif y == maxY: # s
_setRandomTile(_edge, x, y, Tile.EdgeOutside, Random.nextBool(), true, false)
elif (x == minX + 1) or (x == maxX - 1) or (y == minY + 1) or (y == maxY - 1):
if x == minX + 1 and y == minY + 1: # nw
_setRandomTile(_edge, x, y, Tile.EdgeInsideCorner, false, false, false)
elif x == minX + 1 and y == maxY - 1: # sw
_setRandomTile(_edge, x, y, Tile.EdgeInsideCorner, false, true, false)
elif x == maxX - 1 and y == minY + 1: # ne
_setRandomTile(_edge, x, y, Tile.EdgeInsideCorner, true, false, true)
elif x == maxX - 1 and y == maxY - 1: # se
_setRandomTile(_edge, x, y, Tile.EdgeInsideCorner, true, true, false)
elif x == minX + 1: # w
_setRandomTile(_edge, x, y, Tile.EdgeInside, false, Random.nextBool(), true)
elif x == maxX - 1: # e
_setRandomTile(_edge, x, y, Tile.EdgeInside, true, Random.nextBool(), true)
elif y == minY + 1: # n
_setRandomTile(_edge, x, y, Tile.EdgeInside, Random.nextBool(), false, false)
elif y == maxY - 1: # s
_setRandomTile(_edge, x, y, Tile.EdgeInside, Random.nextBool(), true, false)
```