diff --git a/src/Artemis.Core/Models/Profile/Layer.cs b/src/Artemis.Core/Models/Profile/Layer.cs index 756ce6828..05412ec8f 100644 --- a/src/Artemis.Core/Models/Profile/Layer.cs +++ b/src/Artemis.Core/Models/Profile/Layer.cs @@ -189,7 +189,7 @@ namespace Artemis.Core.Models.Profile } var shader = SKShader.CreateSweepGradient(new SKPoint(LayerShape.RenderRectangle.MidX, LayerShape.RenderRectangle.MidY), testColors.ToArray()); - canvas.DrawPath(LayerShape.RenderPath, new SKPaint {Shader = shader}); + canvas.DrawPath(LayerShape.RenderPath, new SKPaint {Shader = shader, Color = new SKColor(0, 0, 0, (byte) (OpacityProperty.CurrentValue * 2.55f)) }); } LayerBrush?.Render(canvas); diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs index 4790a7086..59440501c 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs @@ -146,7 +146,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor protected override void OnActivate() { LoadWorkspaceSettings(); - Task.Run(() => LoadProfiles()); + Task.Run(LoadProfiles); base.OnActivate(); } @@ -184,15 +184,17 @@ namespace Artemis.UI.Screens.Module.ProfileEditor profiles.Add(activeProfile); // Populate the UI collection - Profiles.Clear(); - Profiles.AddRange(profiles.OrderBy(p => p.Name)); + Execute.PostToUIThread(() => + { + Profiles.Clear(); + Profiles.AddRange(profiles.OrderBy(p => p.Name)); + SelectedProfile = activeProfile; - SelectedProfile = activeProfile; + _profileEditorService.ChangeSelectedProfile(SelectedProfile); + if (!activeProfile.IsActivated) + _profileService.ActivateProfile(Module, activeProfile); + }); - _profileEditorService.ChangeSelectedProfile(SelectedProfile); - - if (!activeProfile.IsActivated) - _profileService.ActivateProfile(Module, activeProfile); } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolView.xaml index 8fffea038..e3898bc88 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolView.xaml @@ -28,76 +28,89 @@ Margin="{Binding ControlOffset}" Canvas.Left="{Binding TopCenter.X}" Canvas.Top="{Binding TopCenter.Y}" - Fill="{DynamicResource SecondaryAccentBrush}" + Fill="White" + Stroke="{DynamicResource SecondaryAccentBrush}" + StrokeThickness="0.5" MouseDown="{s:Action ShapeEditMouseDown}" MouseUp="{s:Action ShapeEditMouseUp}" MouseMove="{s:Action TopCenterResize}" /> - + + Cursor="SizeAll"> + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolViewModel.cs index dfee0ed07..4975064de 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/Tools/EditToolViewModel.cs @@ -32,6 +32,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools ProfileViewModel.PanZoomViewModel.PropertyChanged += (sender, args) => UpdateControls(); profileEditorService.SelectedProfileChanged += (sender, args) => Update(); + profileEditorService.SelectedProfileElementChanged += (sender, args) => Update(); profileEditorService.SelectedProfileElementUpdated += (sender, args) => Update(); profileEditorService.ProfilePreviewUpdated += (sender, args) => Update(); } @@ -57,7 +58,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools private void Update() { - if (!(ProfileEditorService.SelectedProfileElement is Layer layer) || layer.LayerShape == null) + if (!(ProfileEditorService.SelectedProfileElement is Layer layer)) return; ShapeRectangle = _layerEditorService.GetShapeRenderRect(layer.LayerShape).ToSKRect(); @@ -92,7 +93,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools { Execute.PostToUIThread(() => { - ControlSize = Math.Max(8 / ProfileViewModel.PanZoomViewModel.Zoom, 4); + ControlSize = Math.Max(10 / ProfileViewModel.PanZoomViewModel.Zoom, 4); ControlOffset = new Thickness(ControlSize / 2 * -1, ControlSize / 2 * -1, 0, 0); OutlineThickness = Math.Max(2 / ProfileViewModel.PanZoomViewModel.Zoom, 1); }); diff --git a/src/Artemis.UI/Services/LayerShapeService.cs b/src/Artemis.UI/Services/LayerShapeService.cs index b2412cee8..46c0fe865 100644 --- a/src/Artemis.UI/Services/LayerShapeService.cs +++ b/src/Artemis.UI/Services/LayerShapeService.cs @@ -148,6 +148,9 @@ namespace Artemis.UI.Services /// public Rect GetShapeRenderRect(LayerShape layerShape) { + if (layerShape == null) + return Rect.Empty; + // Adjust the render rectangle for the difference in render scale var renderScale = _settingsService.GetSetting("Core.RenderScale", 1.0).Value; return new Rect(