private void DeselectPoint(Point p) { if (SelectedTilesValue.ContainsKey(p)) { // Or else it wasn't moved at all SetTile(p, SelectedTilesValue[p]); SelectedTilesValue.Remove(p); } SelectedTiles.Remove(p); }
private void RemoveFromTempSelection(Rectangle area, Rectangle newArea) { if (area.Width == 0 || area.Height == 0) { return; } for (int y = Math.Max(area.Y / TILE_SIZE, 0); y < Math.Min(DivideRoundUp(area.Y + area.Height, TILE_SIZE), Layer.Height); ++y) { for (int x = Math.Max(area.X / TILE_SIZE, 0); x < Math.Min(DivideRoundUp(area.X + area.Width, TILE_SIZE), Layer.Width); ++x) { if (TempSelectionTiles.Contains(new Point(x, y)) && !newArea.IntersectsWith(new Rectangle(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE))) { TempSelectionTiles.Remove(new Point(x, y)); } } } }