mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-11 20:19:26 +08:00
block
This commit is contained in:
@@ -137,14 +137,28 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
var offset = GetOffSetFunc?.Invoke() ?? new Point(0, 0);
|
||||
|
||||
var containBound = new RectangleBase(DataItem.Left + offset.X, DataItem.Top + offset.Y, GetItemWidth(), GetItemHeight());
|
||||
//foreach(var child in Children)
|
||||
//{
|
||||
// var bound = new RectangleBase(DataItem.Left + offset.X, DataItem.Top + offset.Y, child.GetItemWidth(), child.GetItemHeight());
|
||||
//}
|
||||
|
||||
return containBound;
|
||||
}
|
||||
|
||||
public List<RectangleBase> GetChildrenBounds()
|
||||
{
|
||||
List<RectangleBase> bounds = new List<RectangleBase>();
|
||||
var offset = GetOffSetFunc?.Invoke() ?? new Point(0, 0);
|
||||
|
||||
var containBound = new RectangleBase(DataItem.Left + offset.X, DataItem.Top + offset.Y, GetItemWidth(), GetItemHeight());
|
||||
double height = 0;
|
||||
foreach (var child in Children)
|
||||
{
|
||||
var bound = new RectangleBase(DataItem.Left + offset.X, DataItem.Top + offset.Y + height, child.GetItemWidth(), child.GetItemHeight());
|
||||
bounds.Add(bound);
|
||||
|
||||
height += child.GetItemHeight();
|
||||
}
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
public BlockDesignerItemViewModel DataItem
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user