Exemple #1
0
 private int MoveDown(ScreenSettings settings, int y)
 {
     // Get y coordinate after moving the window one grid cell to the bottom.
     y += settings.GridCellHeight;
     // Get y coordinate of the grid cell the window should be snapped to.
     y -= settings.GridCellYOffset(y);
     return(y);
 }
Exemple #2
0
 private int MoveUp(ScreenSettings settings, int y)
 {
     // If window is currently snapped to the edge of a grid cell, make sure to snap it to the
     //  adjacent grid cell on the top.
     y -= 1 + settings.GridOddRow;
     // Get y coordinate of the grid cell the window should be snapped to.
     y -= settings.GridCellYOffset(y);
     return(y);
 }