Fixed LED UI rendering perf

This commit is contained in:
SpoinkyNL committed 2019-08-19 23:10:28 +02:00
1 parent b3e035cfb3
commit dcf206dbaf
2 files changed
+33 -8

No files matched your search

@@ -8,20 +8,22 @@
mc:Ignorable="d"
d:DataContext="{d:DesignInstance rgbDevice:RgbLedViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<Border Width="{Binding Width}" Height="{Binding Height}">
<Border.Background>
<Grid Width="{Binding Width}" Height="{Binding Height}">
<Grid.Background>
<ImageBrush AlignmentX="Center" AlignmentY="Center"
Stretch="Fill"
ImageSource="{Binding Led.Image}" />
</Border.Background>
</Grid.Background>
<Path Data="{Binding DisplayGeometry}" ClipToBounds="False" StrokeThickness="2">
<Path.Fill>
<SolidColorBrush Color="{Binding DisplayColor}" Opacity="0.25" />
</Path.Fill>
<!-- TODO: Causes big perf degradation because it makes the entire path recalculate its size -->
<Path.Stroke>
<SolidColorBrush Color="{Binding DisplayColor}" />
</Path.Stroke>
</Path>
</Border>
<Path Data="{Binding StrokeGeometry}" ClipToBounds="False" StrokeThickness="2">
<Path.Fill>
<SolidColorBrush Color="{Binding DisplayColor}" />
</Path.Fill>
</Path>
</Grid>
</UserControl>