fixed #437
This commit is contained in:
1 parent
79694355de
commit
25a6117ee1
1 file changed
+11
-7
@@ -217,7 +217,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
#region Calc AvailableSize
|
#region Calc AvailableSize
|
||||||
|
|
||||||
_childGraph.Reset();
|
_childGraph.Reset(false);
|
||||||
var boundingSize = _childGraph.GetBoundingSize(Width.IsNaN(), Height.IsNaN());
|
var boundingSize = _childGraph.GetBoundingSize(Width.IsNaN(), Height.IsNaN());
|
||||||
_childGraph.Reset();
|
_childGraph.Reset();
|
||||||
_childGraph.Measure(boundingSize);
|
_childGraph.Measure(boundingSize);
|
||||||
@@ -284,17 +284,21 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
public void Arrange(Size arrangeSize) => Element.Arrange(new Rect(Left, Top, Math.Max(arrangeSize.Width - Left - Right, 0), Math.Max(arrangeSize.Height - Top - Bottom, 0)));
|
public void Arrange(Size arrangeSize) => Element.Arrange(new Rect(Left, Top, Math.Max(arrangeSize.Width - Left - Right, 0), Math.Max(arrangeSize.Height - Top - Bottom, 0)));
|
||||||
|
|
||||||
public void Reset()
|
public void Reset(bool clearPos)
|
||||||
{
|
{
|
||||||
Left = double.NaN;
|
if (clearPos)
|
||||||
Top = double.NaN;
|
{
|
||||||
Right = double.NaN;
|
Left = double.NaN;
|
||||||
Bottom = double.NaN;
|
Top = double.NaN;
|
||||||
|
Right = double.NaN;
|
||||||
|
Bottom = double.NaN;
|
||||||
|
}
|
||||||
Measured = false;
|
Measured = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Size GetBoundingSize()
|
public Size GetBoundingSize()
|
||||||
{
|
{
|
||||||
|
if (Left < 0 || Top < 0) return default;
|
||||||
if (Measured) return BoundingSize;
|
if (Measured) return BoundingSize;
|
||||||
|
|
||||||
if (!OutgoingNodes.Any())
|
if (!OutgoingNodes.Any())
|
||||||
@@ -373,7 +377,7 @@ namespace HandyControl.Controls
|
|||||||
_nodeDic.Clear();
|
_nodeDic.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset() => _nodeDic.Values.Do(node => node.Reset());
|
public void Reset(bool clearPos = true) => _nodeDic.Values.Do(node => node.Reset(clearPos));
|
||||||
|
|
||||||
public GraphNode AddLink(GraphNode from, UIElement to)
|
public GraphNode AddLink(GraphNode from, UIElement to)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user