func (c Canvas) selectionUsedTilePositions(startTS tileSelection, endC, endR int) []tile.Position {
	tilePositions := make([]tile.Position, 0, len(c.selection.tiles))
	deltaC := endC - int(startTS.x)
	deltaR := endR - int(startTS.y)
	for _, ts := range c.selection.tiles {
		col := int(ts.x) + deltaC
		row := int(ts.y) + deltaR
		switch {
		case col < 0, c.draw.numCols <= col,
			row < 0, c.draw.numRows <= row:
			return nil
		}
		tilePositions = append(tilePositions, tile.Position{
			Tile: ts.tile,
			X:    tile.X(col),
			Y:    tile.Y(row),
		})
	}
	return tilePositions
}
// selectionUsedTilePositions computes the used tile positions of the selection.
selectionUsedTilePositions computes the used tile positions of the selection.
// selectionUsedTilePositions computes the used tile positions of the selection .
func (c Canvas) selectionUsedTilePositions(startTS tileSelection, endC, endR int) []tile.Position {
	tilePositions := make([]tile.Position, 0, len(c.selection.tiles))
	deltaC := endC - int(startTS.x)
	deltaR := endR - int(startTS.y)
	for _, ts := range c.selection.tiles {
		col := int(ts.x) + deltaC
		row := int(ts.y) + deltaR
		switch {
		case col < 0, c.draw.numCols <= col,
			row < 0, c.draw.numRows <= row:
			return nil
		}
		tilePositions = append(tilePositions, tile.Position{
			Tile: ts.tile,
			X:    tile.X(col),
			Y:    tile.Y(row),
		})
	}
	return tilePositions
}
func ( c Canvas ) selectionUsedTilePositions ( startTS tileSelection , endC , endR int ) [ ] tile . Position { tilePositions := make ( [ ] tile . Position , 0 , len ( c . selection . tiles ) ) deltaC := endC - int ( startTS . x ) deltaR := endR - int ( startTS . y ) for _ , ts := range c . selection . tiles { col := int ( ts . x ) + deltaC row := int ( ts . y ) + deltaR switch { case col < 0 , c . draw . numCols <= col , row < 0 , c . draw . numRows <= row : return nil } tilePositions = append ( tilePositions , tile . Position { Tile : ts . tile , X : tile . X ( col ) , Y : tile . Y ( row ) , } ) } return tilePositions }
selectionUsedTilePositions computes the used tile positions of the selection.
selectionUsedTilePositions computes the used tile positions of the selection .