Rendering improvements

This commit is contained in:
SpoinkyNL committed 2019-12-06 23:00:30 +01:00
1 parent 9e16605e6b
commit 8795be2cde
11 files changed
+71 -99

No files matched your search

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
@@ -81,8 +82,15 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
private void ApplySurfaceConfiguration(ArtemisSurface surface)
{
List<ArtemisDevice> devices;
lock (Devices)
{
devices = new List<ArtemisDevice>();
devices.AddRange(surface.Devices);
}
// Make sure all devices have an up-to-date VM
foreach (var surfaceDeviceConfiguration in surface.Devices)
foreach (var surfaceDeviceConfiguration in devices)
{
// Create VMs for missing devices
var viewModel = Devices.FirstOrDefault(vm => vm.Device.RgbDevice == surfaceDeviceConfiguration.RgbDevice);
@@ -104,7 +112,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
else
viewModel.Device = surfaceDeviceConfiguration;
}
// Sort the devices by ZIndex
Execute.PostToUIThread(() =>
{