Skip to content

Commit c8f5fef

Browse files
authored
Improved opacity support in Radial Gauge
This change adds support for Opacity in the brushes for the Radial Gauge elements that are drawn with the Composition API: Ticks, ScaleTicks, and Needle.
1 parent b20c6ce commit c8f5fef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Input/RadialGauge/RadialGauge.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ private static void OnFaceChanged(DependencyObject d)
642642
tick = radialGauge._compositor.CreateSpriteVisual();
643643
tick.Size = new Vector2((float)radialGauge.TickWidth, (float)radialGauge.TickLength);
644644
tick.Brush = radialGauge._compositor.CreateColorBrush(radialGauge.TickBrush.Color);
645+
tick.Opacity = (float)radialGauge.TickBrush.Opacity;
645646
tick.Offset = new Vector3(100 - ((float)radialGauge.TickWidth / 2), 0.0f, 0);
646647
tick.CenterPoint = new Vector3((float)radialGauge.TickWidth / 2, 100.0f, 0);
647648
tick.RotationAngleInDegrees = (float)radialGauge.ValueToAngle(i);
@@ -654,6 +655,7 @@ private static void OnFaceChanged(DependencyObject d)
654655
tick = radialGauge._compositor.CreateSpriteVisual();
655656
tick.Size = new Vector2((float)radialGauge.ScaleTickWidth, (float)radialGauge.ScaleWidth);
656657
tick.Brush = radialGauge._compositor.CreateColorBrush(radialGauge.ScaleTickBrush.Color);
658+
tick.Opacity = (float)radialGauge.ScaleTickBrush.Opacity;
657659
tick.Offset = new Vector3(100 - ((float)radialGauge.ScaleTickWidth / 2), (float)radialGauge.ScalePadding, 0);
658660
tick.CenterPoint = new Vector3((float)radialGauge.ScaleTickWidth / 2, 100 - (float)radialGauge.ScalePadding, 0);
659661
tick.RotationAngleInDegrees = (float)radialGauge.ValueToAngle(i);
@@ -665,6 +667,7 @@ private static void OnFaceChanged(DependencyObject d)
665667
radialGauge._needle = radialGauge._compositor.CreateSpriteVisual();
666668
radialGauge._needle.Size = new Vector2((float)radialGauge.NeedleWidth, (float)radialGauge.NeedleLength);
667669
radialGauge._needle.Brush = radialGauge._compositor.CreateColorBrush(radialGauge.NeedleBrush.Color);
670+
radialGauge._needle.Opacity = (float)radialGauge.NeedleBrush.Opacity;
668671
radialGauge._needle.CenterPoint = new Vector3((float)radialGauge.NeedleWidth / 2, (float)radialGauge.NeedleLength, 0);
669672
radialGauge._needle.Offset = new Vector3(100 - ((float)radialGauge.NeedleWidth / 2), 100 - (float)radialGauge.NeedleLength, 0);
670673
radialGauge._root.Children.InsertAtTop(radialGauge._needle);

0 commit comments

Comments
 (0)