add editor, fix some bugs

WIP
This commit is contained in:
Alex Bezdieniezhnykh
2024-09-10 17:10:54 +03:00
parent b4bedb7520
commit 52371ace3a
16 changed files with 498 additions and 148 deletions
@@ -7,7 +7,9 @@ public static class ColorExtensions
public static Color ToColor(this int id)
{
var index = id % ColorValues.Length;
var hex = $"#40{ColorValues[index]}";
var hex = index == -1
? "#40DDDDDD"
: $"#40{ColorValues[index]}";
var color =(Color)ColorConverter.ConvertFromString(hex);
return color;
}
@@ -0,0 +1,15 @@
using System.Windows;
using Azaion.Annotator.DTO;
namespace Azaion.Annotator.Extensions;
public static class WindowExtensions
{
public static WindowConfig GetConfig(this Window window) =>
new()
{
WindowSize = new Size(window.Width, window.Height),
WindowLocation = new Point(window.Left, window.Top),
FullScreen = window.WindowState == WindowState.Maximized
};
}