mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
Broke the surface editor
Added device properties to surface editor though!
This commit is contained in:
1 parent
6cf3344ce7
commit
9e15bd51e8
20 files changed
+444
-79
No files matched your search
@@ -7,7 +7,7 @@
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="213.053" d:DesignWidth="254.425">
|
||||
<StackPanel Margin="16">
|
||||
<StackPanel Margin="16" UseLayoutRounding="True">
|
||||
<TextBlock>
|
||||
Add a new surface layout
|
||||
</TextBlock>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<UserControl x:Class="Artemis.UI.Screens.SurfaceEditor.Dialogs.SurfaceDeviceConfigView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:surfaceEditor="clr-namespace:Artemis.UI.Screens.SurfaceEditor.Dialogs"
|
||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="351.305" d:DesignWidth="262.163"
|
||||
d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceDeviceConfigViewModel}}">
|
||||
<StackPanel Margin="16" UseLayoutRounding="True">
|
||||
<TextBlock Text="{Binding Title}" Style="{StaticResource MaterialDesignTitleTextBlock}" />
|
||||
|
||||
<Label>X-coordinate</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="X-coordinate"
|
||||
Value="{Binding X}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Interval="1"
|
||||
StringFormat="0" />
|
||||
|
||||
<Label>Y-coordinate</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="Y-coordinate"
|
||||
Value="{Binding Y}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Interval="1"
|
||||
StringFormat="0" />
|
||||
|
||||
<Label>Scale</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="Scale"
|
||||
Value="{Binding Scale}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Interval="0.1"
|
||||
StringFormat="0.00" />
|
||||
|
||||
<Label>Rotation</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="Rotation"
|
||||
Value="{Binding Rotation}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Maximum="359"
|
||||
Interval="1"
|
||||
StringFormat="0" />
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
|
||||
Command="{s:Action Cancel}">
|
||||
<Button.CommandParameter>
|
||||
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
False
|
||||
</system:Boolean>
|
||||
</Button.CommandParameter>
|
||||
CANCEL
|
||||
</Button>
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0"
|
||||
Command="{s:Action Accept}">
|
||||
<Button.CommandParameter>
|
||||
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
True
|
||||
</system:Boolean>
|
||||
</Button.CommandParameter>
|
||||
APPLY
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.UI.Screens.SurfaceEditor.Visualization;
|
||||
using Artemis.UI.ViewModels.Dialogs;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SurfaceEditor.Dialogs
|
||||
{
|
||||
public class SurfaceDeviceConfigViewModel : DialogViewModelBase
|
||||
{
|
||||
public SurfaceDeviceConfigViewModel(SurfaceDeviceViewModel surfaceDeviceViewModel, IModelValidator<SurfaceDeviceConfigViewModel> validator)
|
||||
: base(validator)
|
||||
{
|
||||
SurfaceDeviceViewModel = surfaceDeviceViewModel;
|
||||
Title = $"{SurfaceDeviceViewModel.Device.RgbDevice.DeviceInfo.DeviceName} - Properties";
|
||||
|
||||
X = (int) SurfaceDeviceViewModel.Device.X;
|
||||
Y = (int) SurfaceDeviceViewModel.Device.Y;
|
||||
Scale = SurfaceDeviceViewModel.Device.Scale;
|
||||
Rotation = (int) SurfaceDeviceViewModel.Device.Rotation;
|
||||
}
|
||||
|
||||
public SurfaceDeviceViewModel SurfaceDeviceViewModel { get; }
|
||||
public string Title { get; set; }
|
||||
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public double Scale { get; set; }
|
||||
public int Rotation { get; set; }
|
||||
|
||||
public async Task Accept()
|
||||
{
|
||||
await ValidateAsync();
|
||||
if (HasErrors)
|
||||
return;
|
||||
|
||||
SurfaceDeviceViewModel.Device.X = X;
|
||||
SurfaceDeviceViewModel.Device.Y = Y;
|
||||
SurfaceDeviceViewModel.Device.Scale = Scale;
|
||||
SurfaceDeviceViewModel.Device.Rotation = Rotation;
|
||||
|
||||
Session.Close(true);
|
||||
}
|
||||
|
||||
public async Task Cancel()
|
||||
{
|
||||
Session.Close(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Artemis.UI.Screens.SurfaceEditor.Dialogs
|
||||
{
|
||||
public class SurfaceDeviceConfigViewModelValidator : AbstractValidator<SurfaceDeviceConfigViewModel>
|
||||
{
|
||||
public SurfaceDeviceConfigViewModelValidator()
|
||||
{
|
||||
RuleFor(m => m.X).GreaterThanOrEqualTo(0).WithMessage("X-coordinate must be 0 or greater");
|
||||
|
||||
RuleFor(m => m.Y).GreaterThanOrEqualTo(0).WithMessage("Y-coordinate must be 0 or greater");
|
||||
|
||||
RuleFor(m => m.Scale).GreaterThanOrEqualTo(0.2).WithMessage("Scale must be 0.2 or greater");
|
||||
|
||||
RuleFor(m => m.Rotation).GreaterThanOrEqualTo(0).WithMessage("Rotation must be 0 or greater");
|
||||
RuleFor(m => m.Rotation).LessThanOrEqualTo(359).WithMessage("Rotation must be 359 or less");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,14 +38,17 @@
|
||||
</StackPanel>
|
||||
|
||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="1" Grid.Column="0"
|
||||
VerticalAlignment="Stretch" Margin="0,0,5,0">
|
||||
VerticalAlignment="Stretch" Margin="0,0,5,0" >
|
||||
<Grid ClipToBounds="True"
|
||||
Focusable="True"
|
||||
FocusVisualStyle="{StaticResource FocusVisual}"
|
||||
KeyUp="{s:Action EditorGridKeyUp}"
|
||||
KeyDown="{s:Action EditorGridKeyDown}"
|
||||
MouseWheel="{s:Action EditorGridMouseWheel}"
|
||||
MouseUp="{s:Action EditorGridMouseClick}"
|
||||
MouseDown="{s:Action EditorGridMouseClick}"
|
||||
MouseMove="{s:Action EditorGridMouseMove}">
|
||||
MouseMove="{s:Action EditorGridMouseMove}"
|
||||
Cursor="{Binding Cursor}">
|
||||
<Grid.Background>
|
||||
<VisualBrush TileMode="Tile" Stretch="Uniform"
|
||||
Viewport="{Binding PanZoomViewModel.BackgroundViewport}" ViewportUnits="Absolute">
|
||||
@@ -101,8 +104,8 @@
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style TargetType="ContentPresenter">
|
||||
<Setter Property="Canvas.Left" Value="{Binding X}" />
|
||||
<Setter Property="Canvas.Top" Value="{Binding Y}" />
|
||||
<Setter Property="Canvas.Left" Value="{Binding RgbDeviceRectangle.Location.X}" />
|
||||
<Setter Property="Canvas.Top" Value="{Binding RgbDeviceRectangle.Location.Y}" />
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
<ItemsControl.ItemTemplate>
|
||||
@@ -110,32 +113,37 @@
|
||||
<ContentControl Width="{Binding Device.RgbDevice.Size.Width}"
|
||||
Height="{Binding Device.RgbDevice.Size.Height}"
|
||||
s:View.Model="{Binding}">
|
||||
<ContentControl.RenderTransform>
|
||||
<RotateTransform Angle="{Binding Device.RgbDevice.Rotation.Degrees}" CenterX="{Binding RgbDeviceRectangle.Center.X}" CenterY="{Binding RgbDeviceRectangle.Center.Y}"></RotateTransform>
|
||||
</ContentControl.RenderTransform>
|
||||
<ContentControl.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Bring to Front" Command="{s:Action BringToFront}"
|
||||
CommandParameter="{Binding}">
|
||||
<MenuItem Header="Bring to Front" Command="{s:Action BringToFront}" CommandParameter="{Binding}">
|
||||
<MenuItem.Icon>
|
||||
<materialDesign:PackIcon Kind="ArrangeBringToFront" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Bring Forward" Command="{s:Action BringForward}"
|
||||
CommandParameter="{Binding}">
|
||||
<MenuItem Header="Bring Forward" Command="{s:Action BringForward}" CommandParameter="{Binding}">
|
||||
<MenuItem.Icon>
|
||||
<materialDesign:PackIcon Kind="ArrangeBringForward" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Send to Back" Command="{s:Action SendToBack}"
|
||||
CommandParameter="{Binding}">
|
||||
<MenuItem Header="Send to Back" Command="{s:Action SendToBack}" CommandParameter="{Binding}">
|
||||
<MenuItem.Icon>
|
||||
<materialDesign:PackIcon Kind="ArrangeSendToBack" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Send Backward" Command="{s:Action SendBackward}"
|
||||
CommandParameter="{Binding}">
|
||||
<MenuItem Header="Send Backward" Command="{s:Action SendBackward}" CommandParameter="{Binding}">
|
||||
<MenuItem.Icon>
|
||||
<materialDesign:PackIcon Kind="ArrangeSendBackward" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="View properties" Command="{s:Action ViewProperties}" CommandParameter="{Binding}">
|
||||
<MenuItem.Icon>
|
||||
<materialDesign:PackIcon Kind="Gear" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</ContentControl.ContextMenu>
|
||||
</ContentControl>
|
||||
@@ -179,8 +187,7 @@
|
||||
|
||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="1" Grid.Column="2"
|
||||
VerticalAlignment="Stretch" Margin="5,0,0,0">
|
||||
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True"
|
||||
UseLayoutRounding="True">
|
||||
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True">
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.Core.Services.Storage;
|
||||
using Artemis.Core.Services.Storage.Interfaces;
|
||||
using Artemis.UI.Screens.Shared;
|
||||
using Artemis.UI.Screens.SurfaceEditor.Dialogs;
|
||||
using Artemis.UI.Screens.SurfaceEditor.Visualization;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using Ninject.Parameters;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SurfaceEditor
|
||||
@@ -30,6 +32,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
SurfaceConfigurations = new ObservableCollection<Surface>();
|
||||
SelectionRectangle = new RectangleGeometry();
|
||||
PanZoomViewModel = new PanZoomViewModel();
|
||||
Cursor = null;
|
||||
|
||||
_surfaceService = surfaceService;
|
||||
_dialogService = dialogService;
|
||||
@@ -41,6 +44,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
public RectangleGeometry SelectionRectangle { get; set; }
|
||||
public PanZoomViewModel PanZoomViewModel { get; set; }
|
||||
public PluginSetting<GridLength> SurfaceListWidth { get; set; }
|
||||
public Cursor Cursor { get; set; }
|
||||
|
||||
public Surface SelectedSurface
|
||||
{
|
||||
@@ -120,8 +124,8 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
// Sort the devices by ZIndex
|
||||
Execute.OnUIThread(() =>
|
||||
{
|
||||
foreach (var device in Devices.OrderBy(d => d.ZIndex).ToList())
|
||||
Devices.Move(Devices.IndexOf(device), device.ZIndex - 1);
|
||||
foreach (var device in Devices.OrderBy(d => d.Device.ZIndex).ToList())
|
||||
Devices.Move(Devices.IndexOf(device), device.Device.ZIndex - 1);
|
||||
});
|
||||
|
||||
_surfaceService.SetActiveSurfaceConfiguration(SelectedSurface);
|
||||
@@ -177,7 +181,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
for (var i = 0; i < Devices.Count; i++)
|
||||
{
|
||||
var deviceViewModel = Devices[i];
|
||||
deviceViewModel.ZIndex = i + 1;
|
||||
deviceViewModel.Device.ZIndex = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +194,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
for (var i = 0; i < Devices.Count; i++)
|
||||
{
|
||||
var deviceViewModel = Devices[i];
|
||||
deviceViewModel.ZIndex = i + 1;
|
||||
deviceViewModel.Device.ZIndex = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +204,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
for (var i = 0; i < Devices.Count; i++)
|
||||
{
|
||||
var deviceViewModel = Devices[i];
|
||||
deviceViewModel.ZIndex = i + 1;
|
||||
deviceViewModel.Device.ZIndex = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,10 +216,21 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
for (var i = 0; i < Devices.Count; i++)
|
||||
{
|
||||
var deviceViewModel = Devices[i];
|
||||
deviceViewModel.ZIndex = i + 1;
|
||||
deviceViewModel.Device.ZIndex = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ViewProperties(SurfaceDeviceViewModel surfaceDeviceViewModel)
|
||||
{
|
||||
var madeChanges = await _dialogService.ShowDialog<SurfaceDeviceConfigViewModel>(new Dictionary<string, object>
|
||||
{
|
||||
{"surfaceDeviceViewModel", surfaceDeviceViewModel}
|
||||
});
|
||||
|
||||
if ((bool) madeChanges)
|
||||
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Selection
|
||||
@@ -241,6 +256,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
// ReSharper disable once UnusedMember.Global - Called from view
|
||||
public void EditorGridMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
((Grid) sender).Focus();
|
||||
// If holding down Ctrl, pan instead of move/select
|
||||
if (IsPanKeyDown())
|
||||
{
|
||||
@@ -285,12 +301,6 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
_mouseDragStartPoint = position;
|
||||
}
|
||||
|
||||
// While dragging always show a hand to avoid cursor flicker
|
||||
if (_mouseDragStatus == MouseDragStatus.Dragging)
|
||||
Mouse.OverrideCursor = Cursors.Hand;
|
||||
else
|
||||
Mouse.OverrideCursor = Cursors.Arrow;
|
||||
|
||||
// Any time dragging starts, start with a new rect
|
||||
SelectionRectangle.Rect = new Rect();
|
||||
}
|
||||
@@ -311,7 +321,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
else
|
||||
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
|
||||
|
||||
Mouse.OverrideCursor = null;
|
||||
|
||||
_mouseDragStatus = MouseDragStatus.None;
|
||||
}
|
||||
|
||||
@@ -353,13 +363,13 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
public void EditorGridKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if ((e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl) && e.IsDown)
|
||||
Mouse.OverrideCursor = Cursors.ScrollAll;
|
||||
Cursor = Cursors.ScrollAll;
|
||||
}
|
||||
|
||||
public void EditorGridKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if ((e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl) && e.IsUp)
|
||||
Mouse.OverrideCursor = null;
|
||||
Cursor = null;
|
||||
}
|
||||
|
||||
public void Pan(object sender, MouseEventArgs e)
|
||||
|
||||
@@ -3,7 +3,10 @@ using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using PropertyChanged;
|
||||
using RGB.NET.Core;
|
||||
using Stylet;
|
||||
using Point = System.Windows.Point;
|
||||
|
||||
namespace Artemis.UI.Screens.SurfaceEditor.Visualization
|
||||
{
|
||||
@@ -23,52 +26,44 @@ namespace Artemis.UI.Screens.SurfaceEditor.Visualization
|
||||
foreach (var led in Device.RgbDevice)
|
||||
_leds.Add(new SurfaceLedViewModel(led));
|
||||
}
|
||||
|
||||
Device.DeviceUpdated += DeviceOnDeviceUpdated;
|
||||
}
|
||||
|
||||
private void DeviceOnDeviceUpdated(object sender, EventArgs e)
|
||||
{
|
||||
NotifyOfPropertyChange(() => RgbDeviceRectangle);
|
||||
NotifyOfPropertyChange(() => Device.RgbDevice);
|
||||
}
|
||||
|
||||
public Device Device { get; set; }
|
||||
public SelectionStatus SelectionStatus { get; set; }
|
||||
public Cursor Cursor { get; set; }
|
||||
|
||||
public double X
|
||||
{
|
||||
get => Device.X;
|
||||
set => Device.X = value;
|
||||
}
|
||||
|
||||
public double Y
|
||||
{
|
||||
get => Device.Y;
|
||||
set => Device.Y = value;
|
||||
}
|
||||
|
||||
public int ZIndex
|
||||
{
|
||||
get => Device.ZIndex;
|
||||
set => Device.ZIndex = value;
|
||||
}
|
||||
public Rectangle RgbDeviceRectangle => Device.RgbDevice.DeviceRectangle;
|
||||
|
||||
public IReadOnlyCollection<SurfaceLedViewModel> Leds => _leds.AsReadOnly();
|
||||
|
||||
public Rect DeviceRectangle => Device.RgbDevice == null
|
||||
? new Rect()
|
||||
: new Rect(X, Y, Device.RgbDevice.Size.Width, Device.RgbDevice.Size.Height);
|
||||
: new Rect(Device.X, Device.Y, Device.RgbDevice.Size.Width, Device.RgbDevice.Size.Height);
|
||||
|
||||
public void StartMouseDrag(Point mouseStartPosition)
|
||||
{
|
||||
_dragOffsetX = X - mouseStartPosition.X;
|
||||
_dragOffsetY = Y - mouseStartPosition.Y;
|
||||
_dragOffsetX = Device.X - mouseStartPosition.X;
|
||||
_dragOffsetY = Device.Y - mouseStartPosition.Y;
|
||||
}
|
||||
|
||||
public void UpdateMouseDrag(Point mousePosition)
|
||||
{
|
||||
var roundedX = Math.Round((mousePosition.X + _dragOffsetX) / 10, 0, MidpointRounding.AwayFromZero) * 10;
|
||||
var roundedY = Math.Round((mousePosition.Y + _dragOffsetY) / 10, 0, MidpointRounding.AwayFromZero) * 10;
|
||||
X = Math.Max(0, roundedX);
|
||||
Y = Math.Max(0, roundedY);
|
||||
Device.X = Math.Max(0, roundedX);
|
||||
Device.Y = Math.Max(0, roundedY);
|
||||
}
|
||||
|
||||
// ReSharper disable once UnusedMember.Global - Called from view
|
||||
public void MouseEnter()
|
||||
public void MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (SelectionStatus == SelectionStatus.None)
|
||||
{
|
||||
@@ -86,6 +81,25 @@ namespace Artemis.UI.Screens.SurfaceEditor.Visualization
|
||||
Cursor = Cursors.Arrow;
|
||||
}
|
||||
}
|
||||
|
||||
public MouseDevicePosition GetMouseDevicePosition(Point position)
|
||||
{
|
||||
if ((new Point(0, 0) - position).LengthSquared < 5)
|
||||
{
|
||||
return MouseDevicePosition.TopLeft;
|
||||
}
|
||||
|
||||
return MouseDevicePosition.Regular;
|
||||
}
|
||||
}
|
||||
|
||||
public enum MouseDevicePosition
|
||||
{
|
||||
Regular,
|
||||
TopLeft,
|
||||
TopRight,
|
||||
BottomLeft,
|
||||
BottomRight
|
||||
}
|
||||
|
||||
public enum SelectionStatus
|
||||
|
||||
Reference in new issue
Block a user