Esempio n. 1
0
 public void DragOver(Point point, ushort value)
 {
     SelectedTiles.Clear();
     SelectedTilesValue.Clear();
     point = new Point(point.X / TILE_SIZE, point.Y / TILE_SIZE);
     SelectedTiles.Add(point);
     SelectedTilesValue[point] = value;
 }
 private void AddToTempSelection(Rectangle area)
 {
     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)) && (SelectedTiles.Contains(new Point(x, y)) || Layer.Tiles[y][x] != 0xffff))
             {
                 TempSelectionTiles.Add(new Point(x, y));
             }
         }
     }
 }
Esempio n. 3
0
 public void TempSelection(Rectangle area, bool deselectIfSelected)
 {
     TempSelectionTiles.Clear();
     TempSelectionDeselect = deselectIfSelected;
     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 (SelectedTiles.Contains(new Point(x, y)) || Layer.Tiles[y][x] != 0xffff)
             {
                 TempSelectionTiles.Add(new Point(x, y));
             }
         }
     }
 }