private int MoveRight(ScreenSettings settings, int x) { // Get x coordinate after moving the window one grid cell to the right. x += settings.GridCellWidth; // Get x coordinate of the grid cell the window should be snapped to. x -= settings.GridCellXOffset(x); return(x); }
private int MoveLeft(ScreenSettings settings, int x) { // If window is currently snapped to the edge of a grid cell, make sure to snap it to the // adjacent grid cell on the left. x -= 1 + settings.GridOddCol; // Get x coordinate of the grid cell the window should be snapped to. x -= settings.GridCellXOffset(x); return(x); }