mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
whitespace forced changes (#6002)
This commit is contained in:
@@ -200,259 +200,259 @@ namespace FancyZonesEditor
|
||||
|
||||
if (isDeltaNegative)
|
||||
{
|
||||
DecreaseResizerValues(resizer, orientation);
|
||||
DecreaseResizerValues(resizer, orientation);
|
||||
}
|
||||
else
|
||||
{
|
||||
IncreaseResizerValues(resizer, orientation);
|
||||
}
|
||||
|
||||
// same orientation resizers update
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
if (r.Orientation == orientation)
|
||||
{
|
||||
if ((isHorizontal && r.StartRow == resizer.StartRow && r.StartCol != resizer.StartCol) ||
|
||||
(!isHorizontal && r.StartCol == resizer.StartCol && r.StartRow != resizer.StartRow))
|
||||
{
|
||||
if (isDeltaNegative)
|
||||
{
|
||||
IncreaseResizerValues(r, orientation);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecreaseResizerValues(r, orientation);
|
||||
}
|
||||
|
||||
swappedResizers.Add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// different orientation resizers update
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
if (r.Orientation != resizer.Orientation)
|
||||
{
|
||||
if (isHorizontal)
|
||||
{
|
||||
// vertical resizers corresponding to dragged resizer
|
||||
if (r.StartCol >= resizer.StartCol && r.EndCol < resizer.EndCol)
|
||||
{
|
||||
if (r.StartRow == resizer.StartRow + 2 && isDeltaNegative)
|
||||
{
|
||||
r.StartRow--;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow + 1 && isDeltaNegative)
|
||||
{
|
||||
r.EndRow--;
|
||||
}
|
||||
|
||||
if (r.StartRow == resizer.StartRow && !isDeltaNegative)
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow - 1 && !isDeltaNegative)
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertical resizers corresponding to swapped resizers
|
||||
foreach (GridResizer sr in swappedResizers)
|
||||
{
|
||||
if (r.StartCol >= sr.StartCol && r.EndCol <= sr.EndCol)
|
||||
{
|
||||
if (r.StartRow == resizer.StartRow + 1 && isDeltaNegative)
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow && isDeltaNegative)
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
|
||||
if (r.StartRow == resizer.StartRow + 1 && !isDeltaNegative)
|
||||
{
|
||||
r.StartRow--;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow && !isDeltaNegative)
|
||||
{
|
||||
r.EndRow--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// horizontal resizers corresponding to dragged resizer
|
||||
if (r.StartRow >= resizer.StartRow && r.EndRow < resizer.EndRow)
|
||||
{
|
||||
if (r.StartCol == resizer.StartCol + 3 && isDeltaNegative)
|
||||
{
|
||||
r.StartCol--;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol + 1 && isDeltaNegative)
|
||||
{
|
||||
r.EndCol--;
|
||||
}
|
||||
|
||||
if (r.StartCol == resizer.StartCol && !isDeltaNegative)
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol - 1 && !isDeltaNegative)
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// horizontal resizers corresponding to swapped resizers
|
||||
foreach (GridResizer sr in swappedResizers)
|
||||
{
|
||||
if (r.StartRow >= sr.StartRow && r.EndRow <= sr.EndRow)
|
||||
{
|
||||
if (r.StartCol == resizer.StartCol + 1 && isDeltaNegative)
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol && isDeltaNegative)
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
|
||||
if (r.StartCol == resizer.StartCol + 1 && !isDeltaNegative)
|
||||
{
|
||||
r.StartCol--;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol && !isDeltaNegative)
|
||||
{
|
||||
r.EndCol--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IncreaseResizerValues(resizer, orientation);
|
||||
}
|
||||
|
||||
// same orientation resizers update
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
if (r.Orientation == orientation)
|
||||
{
|
||||
if ((isHorizontal && r.StartRow == resizer.StartRow && r.StartCol != resizer.StartCol) ||
|
||||
(!isHorizontal && r.StartCol == resizer.StartCol && r.StartRow != resizer.StartRow))
|
||||
{
|
||||
if (isDeltaNegative)
|
||||
{
|
||||
IncreaseResizerValues(r, orientation);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecreaseResizerValues(r, orientation);
|
||||
}
|
||||
|
||||
swappedResizers.Add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// different orientation resizers update
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
if (r.Orientation != resizer.Orientation)
|
||||
{
|
||||
if (isHorizontal)
|
||||
{
|
||||
// vertical resizers corresponding to dragged resizer
|
||||
if (r.StartCol >= resizer.StartCol && r.EndCol < resizer.EndCol)
|
||||
{
|
||||
if (r.StartRow == resizer.StartRow + 2 && isDeltaNegative)
|
||||
{
|
||||
r.StartRow--;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow + 1 && isDeltaNegative)
|
||||
{
|
||||
r.EndRow--;
|
||||
}
|
||||
|
||||
if (r.StartRow == resizer.StartRow && !isDeltaNegative)
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow - 1 && !isDeltaNegative)
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertical resizers corresponding to swapped resizers
|
||||
foreach (GridResizer sr in swappedResizers)
|
||||
{
|
||||
if (r.StartCol >= sr.StartCol && r.EndCol <= sr.EndCol)
|
||||
{
|
||||
if (r.StartRow == resizer.StartRow + 1 && isDeltaNegative)
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow && isDeltaNegative)
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
|
||||
if (r.StartRow == resizer.StartRow + 1 && !isDeltaNegative)
|
||||
{
|
||||
r.StartRow--;
|
||||
}
|
||||
|
||||
if (r.EndRow == resizer.EndRow && !isDeltaNegative)
|
||||
{
|
||||
r.EndRow--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// horizontal resizers corresponding to dragged resizer
|
||||
if (r.StartRow >= resizer.StartRow && r.EndRow < resizer.EndRow)
|
||||
{
|
||||
if (r.StartCol == resizer.StartCol + 3 && isDeltaNegative)
|
||||
{
|
||||
r.StartCol--;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol + 1 && isDeltaNegative)
|
||||
{
|
||||
r.EndCol--;
|
||||
}
|
||||
|
||||
if (r.StartCol == resizer.StartCol && !isDeltaNegative)
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol - 1 && !isDeltaNegative)
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// horizontal resizers corresponding to swapped resizers
|
||||
foreach (GridResizer sr in swappedResizers)
|
||||
{
|
||||
if (r.StartRow >= sr.StartRow && r.EndRow <= sr.EndRow)
|
||||
{
|
||||
if (r.StartCol == resizer.StartCol + 1 && isDeltaNegative)
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol && isDeltaNegative)
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
|
||||
if (r.StartCol == resizer.StartCol + 1 && !isDeltaNegative)
|
||||
{
|
||||
r.StartCol--;
|
||||
}
|
||||
|
||||
if (r.EndCol == resizer.EndCol && !isDeltaNegative)
|
||||
{
|
||||
r.EndCol--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateAfterDetach(GridResizer resizer, double delta)
|
||||
{
|
||||
bool isDeltaNegative = delta < 0;
|
||||
Orientation orientation = resizer.Orientation;
|
||||
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
bool notEqual = r.StartRow != resizer.StartRow || r.EndRow != resizer.EndRow || r.StartCol != resizer.StartCol || r.EndCol != resizer.EndCol;
|
||||
if (r.Orientation == orientation && notEqual)
|
||||
{
|
||||
if (orientation == Orientation.Horizontal)
|
||||
{
|
||||
if (r.StartRow > resizer.StartRow || (r.StartRow == resizer.StartRow && isDeltaNegative))
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow > resizer.EndRow || (r.EndRow == resizer.EndRow && isDeltaNegative))
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r.StartCol > resizer.StartCol || (r.StartCol == resizer.StartCol && isDeltaNegative))
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol > resizer.EndCol || (r.EndCol == resizer.EndCol && isDeltaNegative))
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
bool isDeltaNegative = delta < 0;
|
||||
Orientation orientation = resizer.Orientation;
|
||||
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
bool notEqual = r.StartRow != resizer.StartRow || r.EndRow != resizer.EndRow || r.StartCol != resizer.StartCol || r.EndCol != resizer.EndCol;
|
||||
if (r.Orientation == orientation && notEqual)
|
||||
{
|
||||
if (orientation == Orientation.Horizontal)
|
||||
{
|
||||
if (r.StartRow > resizer.StartRow || (r.StartRow == resizer.StartRow && isDeltaNegative))
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow > resizer.EndRow || (r.EndRow == resizer.EndRow && isDeltaNegative))
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r.StartCol > resizer.StartCol || (r.StartCol == resizer.StartCol && isDeltaNegative))
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol > resizer.EndCol || (r.EndCol == resizer.EndCol && isDeltaNegative))
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isDeltaNegative)
|
||||
{
|
||||
IncreaseResizerValues(resizer, orientation);
|
||||
}
|
||||
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
if (r.Orientation != orientation)
|
||||
{
|
||||
if (orientation == Orientation.Vertical)
|
||||
{
|
||||
if (isDeltaNegative)
|
||||
{
|
||||
bool isRowNonAdjacent = r.EndRow < resizer.StartRow || r.StartRow > resizer.EndRow;
|
||||
|
||||
if (r.StartCol > resizer.StartCol + 1 || (r.StartCol == resizer.StartCol + 1 && isRowNonAdjacent))
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol > resizer.EndCol || (r.EndCol == resizer.EndCol && isRowNonAdjacent))
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r.StartCol > resizer.StartCol || (r.StartCol == resizer.StartCol && r.StartRow >= resizer.StartRow && r.EndRow <= resizer.EndRow))
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol > resizer.EndCol - 1 || (r.EndCol == resizer.EndCol - 1 && r.StartRow >= resizer.StartRow && r.EndRow <= resizer.EndRow))
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isDeltaNegative)
|
||||
{
|
||||
bool isColNonAdjacent = r.EndCol < resizer.StartCol || r.StartCol > resizer.EndCol;
|
||||
|
||||
if (r.StartRow > resizer.StartRow + 1 || (r.StartRow == resizer.StartRow + 1 && isColNonAdjacent))
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow > resizer.EndRow || (r.EndRow == resizer.EndRow && isColNonAdjacent))
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r.StartRow > resizer.StartRow || (r.StartRow == resizer.StartRow && r.StartCol >= resizer.StartCol && r.EndCol <= resizer.EndCol))
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow > resizer.EndRow - 1 || (r.EndRow == resizer.EndRow - 1 && r.StartCol >= resizer.StartCol && r.EndCol <= resizer.EndCol))
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (GridResizer r in _resizers)
|
||||
{
|
||||
if (r.Orientation != orientation)
|
||||
{
|
||||
if (orientation == Orientation.Vertical)
|
||||
{
|
||||
if (isDeltaNegative)
|
||||
{
|
||||
bool isRowNonAdjacent = r.EndRow < resizer.StartRow || r.StartRow > resizer.EndRow;
|
||||
|
||||
if (r.StartCol > resizer.StartCol + 1 || (r.StartCol == resizer.StartCol + 1 && isRowNonAdjacent))
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol > resizer.EndCol || (r.EndCol == resizer.EndCol && isRowNonAdjacent))
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r.StartCol > resizer.StartCol || (r.StartCol == resizer.StartCol && r.StartRow >= resizer.StartRow && r.EndRow <= resizer.EndRow))
|
||||
{
|
||||
r.StartCol++;
|
||||
}
|
||||
|
||||
if (r.EndCol > resizer.EndCol - 1 || (r.EndCol == resizer.EndCol - 1 && r.StartRow >= resizer.StartRow && r.EndRow <= resizer.EndRow))
|
||||
{
|
||||
r.EndCol++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isDeltaNegative)
|
||||
{
|
||||
bool isColNonAdjacent = r.EndCol < resizer.StartCol || r.StartCol > resizer.EndCol;
|
||||
|
||||
if (r.StartRow > resizer.StartRow + 1 || (r.StartRow == resizer.StartRow + 1 && isColNonAdjacent))
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow > resizer.EndRow || (r.EndRow == resizer.EndRow && isColNonAdjacent))
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r.StartRow > resizer.StartRow || (r.StartRow == resizer.StartRow && r.StartCol >= resizer.StartCol && r.EndCol <= resizer.EndCol))
|
||||
{
|
||||
r.StartRow++;
|
||||
}
|
||||
|
||||
if (r.EndRow > resizer.EndRow - 1 || (r.EndRow == resizer.EndRow - 1 && r.StartCol >= resizer.StartCol && r.EndCol <= resizer.EndCol))
|
||||
{
|
||||
r.EndRow++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user