Skip to content

Commit 1b79903

Browse files
committed
change node names out
1 parent 62cb357 commit 1b79903

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

Microsoft.Toolkit.Uwp.UI.Controls/TileControl/TileControl.cs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -466,30 +466,27 @@ private void CreateModuloExpression(ScrollViewer scrollViewer, double imageWidth
466466
expressionX.SetReferenceParameter(pParam, propertySetModulo);
467467
expressionY.SetReferenceParameter(pParam, propertySetModulo);
468468

469-
var imageHeightNode = imageHeightParam;
470-
var imageWidthNode = imageWidthParam;
471-
472469
string expressionXVal;
473470
string expressionYVal;
474471
if (scrollViewer == null)
475472
{
476-
var offsetXNode = "Ceil(" + offsetXParam + ")";
477-
var offsetYNode = "Ceil(" + offsetYParam + ")";
473+
var xCommon = "Ceil(" + offsetXParam + ")";
474+
var yCommon = "Ceil(" + offsetYParam + ")";
478475

479476
// expressions are created to simulate a positive and negative modulo with the size of the image and the offset
480477
expressionXVal =
481-
$"{offsetXNode} == 0 " +
478+
$"{xCommon} == 0 " +
482479
$"? 0 " +
483-
$": {offsetXNode} < 0 " +
484-
$"? -(Abs({offsetXNode} - (Ceil({offsetXNode} / {imageWidthNode}) * {imageWidthNode})) % {imageWidthNode}) " +
485-
$": -({imageWidthNode} - ({offsetXNode} % {imageWidthNode}))";
480+
$": {xCommon} < 0 " +
481+
$"? -(Abs({xCommon} - (Ceil({xCommon} / {imageWidthParam}) * {imageWidthParam})) % {imageWidthParam}) " +
482+
$": -({imageWidthParam} - ({xCommon} % {imageWidthParam}))";
486483

487484
expressionYVal =
488-
$"{offsetYNode} == 0 " +
485+
$"{yCommon} == 0 " +
489486
$"? 0 " +
490-
$": {offsetYNode} < 0 " +
491-
$"? -(Abs({offsetYNode} - (Ceil({offsetYNode} / {imageHeightNode}) * {imageHeightNode})) % {imageHeightNode}) " +
492-
$": -({imageHeightNode} - ({offsetYNode} % {imageHeightNode}))";
487+
$": {yCommon} < 0 " +
488+
$"? -(Abs({yCommon} - (Ceil({yCommon} / {imageHeightParam}) * {imageHeightParam})) % {imageHeightParam}) " +
489+
$": -({imageHeightParam} - ({yCommon} % {imageHeightParam}))";
493490
}
494491
else
495492
{
@@ -498,22 +495,21 @@ private void CreateModuloExpression(ScrollViewer scrollViewer, double imageWidth
498495
expressionX.SetReferenceParameter("s", scrollProperties);
499496
expressionY.SetReferenceParameter("s", scrollProperties);
500497

501-
var speed = speedParam;
502-
var xCommon = $"Ceil((s.Translation.X * {speed}) + {offsetXParam})";
498+
var xCommon = $"Ceil((s.Translation.X * {speedParam}) + {offsetXParam})";
503499
expressionXVal =
504500
$"{xCommon} == 0 " +
505501
"? 0 " +
506502
$": {xCommon} < 0 " +
507-
$"? -(Abs({xCommon} - (Ceil({xCommon} / {imageWidthNode}) * {imageWidthNode})) % {imageWidthNode}) " +
508-
$": -({imageWidthNode} - ({xCommon} % {imageWidthNode}))";
503+
$"? -(Abs({xCommon} - (Ceil({xCommon} / {imageWidthParam}) * {imageWidthParam})) % {imageWidthParam}) " +
504+
$": -({imageWidthParam} - ({xCommon} % {imageWidthParam}))";
509505

510-
var yCommon = $"Ceil((s.Translation.Y * {speed}) + {offsetYParam})";
506+
var yCommon = $"Ceil((s.Translation.Y * {speedParam}) + {offsetYParam})";
511507
expressionYVal =
512508
$"{yCommon} == 0 " +
513509
"? 0 " +
514510
$": {yCommon} < 0 " +
515-
$"? -(Abs({yCommon} - (Ceil({yCommon} / {imageHeightNode}) * {imageHeightNode})) % {imageHeightNode}) " +
516-
$": -({imageHeightNode} - ({yCommon} % {imageHeightNode}))";
511+
$"? -(Abs({yCommon} - (Ceil({yCommon} / {imageHeightParam}) * {imageHeightParam})) % {imageHeightParam}) " +
512+
$": -({imageHeightParam} - ({yCommon} % {imageHeightParam}))";
517513
}
518514

519515
if (scrollOrientation == ScrollOrientation.Horizontal || scrollOrientation == ScrollOrientation.Both)

0 commit comments

Comments
 (0)