mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Signitifantly reduced build size
Updated project folder names Show only selected layer in visualization Added rectangle support
This commit is contained in:
1 parent
b74a1b2871
commit
04bc8f013a
52 files changed
+373
-633
No files matched your search
+3
@@ -45,8 +45,11 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
|
||||
|
||||
if (ProfileEditorService.SelectedProfileElement is Layer layer)
|
||||
{
|
||||
// Ensure the shape is an ellipse, we're all about ellipses up here
|
||||
if (!(layer.LayerShape is Ellipse))
|
||||
layer.LayerShape = new Ellipse(layer);
|
||||
|
||||
// Apply the drag rectangle
|
||||
layer.LayerShape.SetFromUnscaledRectangle(DragRectangle.ToSKRect());
|
||||
ProfileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
|
||||
+4
-3
@@ -25,15 +25,16 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
|
||||
// Find out if the click is inside a layer and if so, fill it
|
||||
var position = e.GetPosition((IInputElement) sender);
|
||||
var panZoomVm = ProfileViewModel.PanZoomViewModel;
|
||||
|
||||
var layer = ProfileEditorService.SelectedProfile
|
||||
.GetAllLayers()
|
||||
.FirstOrDefault(l => l.Leds.Any(
|
||||
led => panZoomVm.TransformContainingRect(led.RgbLed.AbsoluteLedRectangle).Contains(position))
|
||||
);
|
||||
|
||||
if (layer != null)
|
||||
layer.LayerShape = new Fill(layer);
|
||||
if (layer == null)
|
||||
return;
|
||||
layer.LayerShape = new Fill(layer);
|
||||
ProfileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -1,8 +1,11 @@
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.LayerShapes;
|
||||
using Artemis.UI.Properties;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using SkiaSharp.Views.WPF;
|
||||
|
||||
namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
|
||||
{
|
||||
@@ -34,6 +37,22 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
|
||||
DragRectangle = GetSquareRectBetweenPoints(MouseDownStartPosition, position);
|
||||
}
|
||||
|
||||
public override void MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
base.MouseUp(sender, e);
|
||||
|
||||
if (ProfileEditorService.SelectedProfileElement is Layer layer)
|
||||
{
|
||||
// Ensure the shape is a rectangle
|
||||
if (!(layer.LayerShape is Rectangle))
|
||||
layer.LayerShape = new Rectangle(layer);
|
||||
|
||||
// Apply the drag rectangle
|
||||
layer.LayerShape.SetFromUnscaledRectangle(DragRectangle.ToSKRect());
|
||||
ProfileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
}
|
||||
|
||||
public override void KeyUp(KeyEventArgs e)
|
||||
{
|
||||
base.KeyUp(e);
|
||||
|
||||
Reference in new issue
Block a user