func (c *Canvas) drawTile(x, y int, t tile.Tile, fromSelection bool) {
	lineColor := c.MainColor
	switch {
	case fromSelection:
		// only draw selected tiles
		if _, ok := c.selection.tiles[t.ID]; !ok {
			return
		}
		lineColor = c.DragColor
		// draw tile with change in location
		x += c.selection.end.x - c.selection.start.x
		y += c.selection.end.y - c.selection.start.y
	case c.selection.moveState == drag:
		// do not draw tiles in selection at their original locations
		if _, ok := c.selection.tiles[t.ID]; ok {
			return
		}
	}
	c.ctx.SetFillColor(c.TileColor)
	c.ctx.FillRect(x, y, c.draw.tileLength, c.draw.tileLength)
	c.ctx.SetFillColor(lineColor)
	c.ctx.StrokeRect(x, y, c.draw.tileLength, c.draw.tileLength)
	c.ctx.SetFillColor(lineColor)
	c.ctx.FillText(string(t.Ch), x+c.draw.textOffset, y+c.draw.tileLength-c.draw.textOffset)
}
// drawTile paints the tile at the specified top-left coordinate.
// The fromSelection flag specifies whether tiles from the selection or those not from the selection are being drawn.
drawTile paints the tile at the specified top-left coordinate.
The fromSelection flag specifies whether tiles from the selection or those not from the selection are being drawn.
// drawTile paints the tile at the specified top - left coordinate . // The fromSelection flag specifies whether tiles from the selection or those not from the selection are being drawn .
func (c *Canvas) drawTile(x, y int, t tile.Tile, fromSelection bool) {
	lineColor := c.MainColor
	switch {
	case fromSelection:
		if _, ok := c.selection.tiles[t.ID]; !ok {
			return
		}
		lineColor = c.DragColor
		x += c.selection.end.x - c.selection.start.x
		y += c.selection.end.y - c.selection.start.y
	case c.selection.moveState == drag:
		if _, ok := c.selection.tiles[t.ID]; ok {
			return
		}
	}
	c.ctx.SetFillColor(c.TileColor)
	c.ctx.FillRect(x, y, c.draw.tileLength, c.draw.tileLength)
	c.ctx.SetFillColor(lineColor)
	c.ctx.StrokeRect(x, y, c.draw.tileLength, c.draw.tileLength)
	c.ctx.SetFillColor(lineColor)
	c.ctx.FillText(string(t.Ch), x+c.draw.textOffset, y+c.draw.tileLength-c.draw.textOffset)
}
func ( c * Canvas ) drawTile ( x , y int , t tile . Tile , fromSelection bool ) { lineColor := c . MainColor switch { case fromSelection : if _ , ok := c . selection . tiles [ t . ID ] ; ! ok { return } lineColor = c . DragColor x += c . selection . end . x - c . selection . start . x y += c . selection . end . y - c . selection . start . y case c . selection . moveState == drag : if _ , ok := c . selection . tiles [ t . ID ] ; ok { return } } c . ctx . SetFillColor ( c . TileColor ) c . ctx . FillRect ( x , y , c . draw . tileLength , c . draw . tileLength ) c . ctx . SetFillColor ( lineColor ) c . ctx . StrokeRect ( x , y , c . draw . tileLength , c . draw . tileLength ) c . ctx . SetFillColor ( lineColor ) c . ctx . FillText ( string ( t . Ch ) , x + c . draw . textOffset , y + c . draw . tileLength - c . draw . textOffset ) }
drawTile paints the tile at the specified top-left coordinate.
drawTile paints the tile at the specified top - left coordinate .
// only draw selected tiles // draw tile with change in location // do not draw tiles in selection at their original locations