Skip to content

Commit

Permalink
Removed unnecessary alpha SpotLight property
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Jul 11, 2017
1 parent d6827ca commit 9360c9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 32 deletions.
31 changes: 2 additions & 29 deletions UICompositionAnimations/Lights/PointerPositionSpotLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,6 @@ public class PointerPositionSpotLight : XamlLight
{
#region Properties

/// <summary>
/// Gets or sets the alpha channel value for the light to display
/// </summary>
public byte Alpha
{
get { return GetValue(AlphaProperty).To<byte>(); }
set { SetValue(AlphaProperty, value); }
}

/// <summary>
/// Gets the <see cref="DependencyProperty"/> for the <see cref="Alpha"/> property
/// </summary>
public static readonly DependencyProperty AlphaProperty =
DependencyProperty.Register(nameof(Alpha), typeof(byte), typeof(PointerPositionSpotLight), new PropertyMetadata(byte.MaxValue, OnAlphaPropertyChanged));

private static void OnAlphaPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
PointerPositionSpotLight l = d as PointerPositionSpotLight;
if (l?._Light != null)
{
byte alpha = e.NewValue.To<byte>();
Color color = l._Light.InnerConeColor;
color.A = alpha;
l._Light.InnerConeColor = l._Light.OuterConeColor = color;
}
}

/// <summary>
/// Gets or sets the intensity of the light. A higher value will result in a brighter light
/// </summary>
Expand All @@ -66,7 +39,7 @@ private static void OnShadePropertyChanged(DependencyObject d, DependencyPropert
byte shade = e.NewValue.To<byte>();
Color color = new Color
{
A = l.Alpha,
A = byte.MaxValue,
R = shade,
G = shade,
B = shade
Expand Down Expand Up @@ -225,7 +198,7 @@ protected override void OnConnected(UIElement newElement)
_Animation.SetReferenceParameter("pointer", pointer);
_Animation.SetReferenceParameter("props", _Properties);
_Light.StartAnimation("Offset", _Animation);
_Light.InnerConeColor = _Light.OuterConeColor = Color.FromArgb(Alpha, Shade, Shade, Shade);
_Light.InnerConeColor = _Light.OuterConeColor = Color.FromArgb(byte.MaxValue, Shade, Shade, Shade);
_Light.InnerConeAngleInDegrees = 0;
_Light.OuterConeAngleInDegrees = OuterConeAngle;
_Light.ConstantAttenuation = Active ? 0 : InactiveAttenuationValue;
Expand Down
2 changes: 1 addition & 1 deletion UICompositionAnimations/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.6.3.0")]
[assembly: AssemblyVersion("2.6.4.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
4 changes: 2 additions & 2 deletions UICompositionAnimations/UICompositionAnimations.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package >
<metadata>
<id>Sergio0694.UWP.UICompositionAnimations</id>
<version>2.6.3.0</version>
<version>2.6.4.0</version>
<title>UICompositionAnimations</title>
<description>A wrapper UWP PCL to work with Windows.UI.Composition and XAML animations, and Win2D effects</description>
<authors>Sergio Pedri</authors>
<owners>Sergio Pedri</owners>
<projectUrl>https://github.com/Sergio0694/UICompositionAnimations</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>Added alpha and shade properties to the spot light class</releaseNotes>
<releaseNotes>Added attenuation property to the SpotLight, minor refactoring</releaseNotes>
<copyright>Copyright 2017</copyright>
<tags>uwp composition animations xaml csharp windows winrt universal app ui win2d graphics</tags>
</metadata>
Expand Down

0 comments on commit 9360c9c

Please sign in to comment.