线条控件

This commit is contained in:
艾竹
2023-01-25 14:42:01 +08:00
parent a01eb8825a
commit 40590bf98d
10 changed files with 1496 additions and 109 deletions

View File

@@ -56,8 +56,9 @@ namespace AIStudio.Wpf.DiagramDesigner
if (Root != null && Root.ColorViewModel != null)
{
this.ColorViewModel = CopyHelper.Mapper(Root.ColorViewModel);
this.ColorViewModel = CopyHelper.Mapper(Root.ColorViewModel);
}
this.ColorViewModel.FillColor.Color = Colors.Red;
if (sinkConnectorInfo is FullyCreatedConnectorInfo sink && sink.DataItem.ShowArrow == false)
{
this.ColorViewModel.RightArrowPathStyle = ArrowPathStyle.None;
@@ -714,7 +715,7 @@ namespace AIStudio.Wpf.DiagramDesigner
label.IsSelected = true;
Labels.Add(label);
var paths = Labels.Count > 0 ? PathGeneratorResult.Paths.Select(p => new SvgPath(p)).ToArray() : Array.Empty<SvgPath>();
var paths = Labels.Count > 0 ? PathGeneratorResult?.Paths.Select(p => new SvgPath(p)).ToArray() : Array.Empty<SvgPath>();
label.UpdatePosition(paths);
}

View File

@@ -105,6 +105,9 @@ namespace AIStudio.Wpf.DiagramDesigner
public void UpdatePosition(SvgPath[] paths)
{
if (paths == null)
return;
var position = FindPosition(paths);
if (position == null)
return;

View File

@@ -49,7 +49,7 @@ namespace AIStudio.Wpf.DiagramDesigner
ColorViewModel = new ColorViewModel()
{
LineColor = new ColorObject() { Color = Color.FromArgb(0xAA, 0x00, 0x00, 0x80) },
FillColor = new ColorObject() { Color = Colors.Lavender },
FillColor = new ColorObject() { Color = Colors.White },
};
}