Skip to content

Commit

Permalink
Fixed param name generation in ExpressionNode
Browse files Browse the repository at this point in the history
Fixes #4011
  • Loading branch information
Sergio0694 committed May 4, 2021
1 parent 0c1fb1b commit a042ce3
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,10 @@ internal void EnsureReferenceInfo()
}

// Create a map to store the generated paramNames for each CompObj
uint id = 0;
_compObjToParamNameMap = new Dictionary<CompositionObject, string>();
foreach (var compObj in compObjects)
{
// compObj.ToString() will return something like "Windows.UI.Composition.SpriteVisual"
// Make it look like "SpriteVisual_1"
string paramName = compObj.ToString();
paramName = $"{paramName.Substring(paramName.LastIndexOf('.') + 1)}_{++id}"; // make sure the created param name doesn't overwrite a custom name
string paramName = Guid.NewGuid().ToUppercaseAsciiLetters();

_compObjToParamNameMap.Add(compObj, paramName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using System.Diagnostics.Contracts;

namespace Microsoft.Toolkit.Uwp.UI.Media
namespace Microsoft.Toolkit.Uwp.UI.Animations
{
/// <summary>
/// An extension <see langword="class"/> for the <see cref="Guid"/> type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Diagnostics.Contracts;
using System.Threading.Tasks;
using Microsoft.Graphics.Canvas.Effects;
using Microsoft.Toolkit.Uwp.UI.Animations;
using Windows.Graphics.Effects;
using Windows.UI;
using Windows.UI.Composition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Graphics.Canvas.Effects;
using Microsoft.Toolkit.Uwp.UI.Animations;
using Windows.Graphics.Effects;
using Windows.UI;
using Windows.UI.Composition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using Microsoft.Toolkit.Uwp.UI.Animations;
using Microsoft.Toolkit.Uwp.UI.Media.Helpers;
using Microsoft.Toolkit.Uwp.UI.Media.Helpers.Cache;
using Windows.Graphics.Effects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Graphics.Canvas.Effects;
using Microsoft.Toolkit.Uwp.UI.Animations;
using Windows.Graphics.Effects;
using Windows.UI.Composition;
using CanvasBlendEffect = Microsoft.Graphics.Canvas.Effects.BlendEffect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Threading.Tasks;
using Microsoft.Toolkit.Uwp.UI.Animations;
using Windows.Graphics.Effects;
using Windows.UI.Composition;
using Windows.UI.Xaml;
Expand Down

0 comments on commit a042ce3

Please sign in to comment.