mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
一个小bug
This commit is contained in:
@@ -110,6 +110,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
IsLoaded = false;
|
||||
if (Geometry != null)
|
||||
{
|
||||
var left = Geometry.Bounds.Left;
|
||||
var top = Geometry.Bounds.Top;
|
||||
if (Geometry.Transform is TransformGroup transformGroup)
|
||||
{
|
||||
TranslateTransform translateTransform = transformGroup.Children.OfType<TranslateTransform>().FirstOrDefault();
|
||||
@@ -130,7 +132,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
Geometry = Geometry.GetWidenedPathGeometry(aPen); //可擦除,需要把Geometry转成几何图像,所以不能有填充色
|
||||
|
||||
}
|
||||
UpdateLocation();
|
||||
UpdateLocation(new Point(left, top));
|
||||
}
|
||||
IsLoaded = true;
|
||||
}
|
||||
@@ -234,21 +236,21 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
base.AddToSelection(selected, clearother);
|
||||
}
|
||||
|
||||
protected virtual void UpdateLocation()
|
||||
protected virtual void UpdateLocation(Point point)
|
||||
{
|
||||
if (Erasable)
|
||||
{
|
||||
ItemWidth = Geometry.Bounds.Width - ColorViewModel.LineWidth * 0.5;
|
||||
ItemHeight = Geometry.Bounds.Height - ColorViewModel.LineWidth * 0.5;
|
||||
Left = Points[0].X;
|
||||
Top = Points[0].Y;
|
||||
Left = point.X;
|
||||
Top = point.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemWidth = Geometry.Bounds.Width + ColorViewModel.LineWidth * 0.5;
|
||||
ItemHeight = Geometry.Bounds.Height + ColorViewModel.LineWidth * 0.5;
|
||||
Left = Points[0].X;
|
||||
Top = Points[0].Y;
|
||||
Left = point.X;
|
||||
Top = point.Y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
new SolidColorBrush(FontViewModel.FontColor));
|
||||
|
||||
Geometry = formattedText.BuildGeometry(new Point()).GetFlattenedPathGeometry();
|
||||
UpdateLocation();
|
||||
UpdateLocation(Points[0]);
|
||||
IsLoaded = true;
|
||||
}
|
||||
this.SelectedDisable = Erasable;
|
||||
@@ -124,12 +124,12 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateLocation()
|
||||
protected override void UpdateLocation(Point point)
|
||||
{
|
||||
ItemWidth = Geometry.Bounds.Width + 3;
|
||||
ItemHeight = Geometry.Bounds.Height + 3;
|
||||
Left = Points[0].X;
|
||||
Top = Points[0].Y;
|
||||
Left = point.X;
|
||||
Top = point.Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user