func (c *Canvas) moveStart(pp pixelPosition) {
	if !c.canMove() {
		return
	}
	c.selection.start, c.selection.end = pp, pp
	ts := c.tileSelection(pp)
	if c.selection.moveState == swap {
		switch {
		case ts == nil:
			c.selection.setMoveState(none)
			c.log.Info("swap cancelled")
		default:
			tileID := ts.tile.ID
			c.selection.tiles[tileID] = *ts
		}
		return
	}
	hasPreviousSelection := len(c.selection.tiles) > 0
	switch {
	case hasPreviousSelection && ts != nil:
		tileID := ts.tile.ID
		if _, ok := c.selection.tiles[tileID]; !ok {
			c.selection.tiles = make(map[tile.ID]tileSelection)
			c.selection.tiles[tileID] = *ts
		}
		c.selection.setMoveState(drag)
	case hasPreviousSelection: // && ts == nil
		c.selection.tiles = make(map[tile.ID]tileSelection)
		c.selection.setMoveState(rect)
		c.Redraw()
	case ts != nil: // && !hasPreviousSelection
		tileID := ts.tile.ID
		c.selection.tiles[tileID] = *ts
		c.selection.setMoveState(drag)
	default: // !hasPerviousSelection && ts == nil
		c.selection.setMoveState(rect)
	}
}
// moveStart should be called when a move is started to be made at the specified coordinates.
moveStart should be called when a move is started to be made at the specified coordinates.
// moveStart should be called when a move is started to be made at the specified coordinates .
func (c *Canvas) moveStart(pp pixelPosition) {
	if !c.canMove() {
		return
	}
	c.selection.start, c.selection.end = pp, pp
	ts := c.tileSelection(pp)
	if c.selection.moveState == swap {
		switch {
		case ts == nil:
			c.selection.setMoveState(none)
			c.log.Info("swap cancelled")
		default:
			tileID := ts.tile.ID
			c.selection.tiles[tileID] = *ts
		}
		return
	}
	hasPreviousSelection := len(c.selection.tiles) > 0
	switch {
	case hasPreviousSelection && ts != nil:
		tileID := ts.tile.ID
		if _, ok := c.selection.tiles[tileID]; !ok {
			c.selection.tiles = make(map[tile.ID]tileSelection)
			c.selection.tiles[tileID] = *ts
		}
		c.selection.setMoveState(drag)
	case hasPreviousSelection: 
		c.selection.tiles = make(map[tile.ID]tileSelection)
		c.selection.setMoveState(rect)
		c.Redraw()
	case ts != nil: 
		tileID := ts.tile.ID
		c.selection.tiles[tileID] = *ts
		c.selection.setMoveState(drag)
	default: 
		c.selection.setMoveState(rect)
	}
}
func ( c * Canvas ) moveStart ( pp pixelPosition ) { if ! c . canMove ( ) { return } c . selection . start , c . selection . end = pp , pp ts := c . tileSelection ( pp ) if c . selection . moveState == swap { switch { case ts == nil : c . selection . setMoveState ( none ) c . log . Info ( " " ) default : tileID := ts . tile . ID c . selection . tiles [ tileID ] = * ts } return } hasPreviousSelection := len ( c . selection . tiles ) > 0 switch { case hasPreviousSelection && ts != nil : tileID := ts . tile . ID if _ , ok := c . selection . tiles [ tileID ] ; ! ok { c . selection . tiles = make ( map [ tile . ID ] tileSelection ) c . selection . tiles [ tileID ] = * ts } c . selection . setMoveState ( drag ) case hasPreviousSelection : c . selection . tiles = make ( map [ tile . ID ] tileSelection ) c . selection . setMoveState ( rect ) c . Redraw ( ) case ts != nil : tileID := ts . tile . ID c . selection . tiles [ tileID ] = * ts c . selection . setMoveState ( drag ) default : c . selection . setMoveState ( rect ) } }
moveStart should be called when a move is started to be made at the specified coordinates.
moveStart should be called when a move is started to be made at the specified coordinates .
// && ts == nil // && !hasPreviousSelection // !hasPerviousSelection && ts == nil