fix: fixed a measure issue of RelativePanel
This commit is contained in:
1 parent
f53e66312a
commit
5540eedbcf
1 file changed
+9
-1
@@ -417,10 +417,18 @@ public class RelativePanel : Panel
|
||||
|
||||
public void Measure(Size availableSize)
|
||||
{
|
||||
AvailableSize = availableSize;
|
||||
AvailableSize = EnsureValidSize(availableSize);
|
||||
Measure(_nodeDic.Values, null);
|
||||
}
|
||||
|
||||
private static Size EnsureValidSize(Size size)
|
||||
{
|
||||
var width = double.IsInfinity(size.Width) ? 0 : size.Width;
|
||||
var height = double.IsInfinity(size.Height) ? 0 : size.Height;
|
||||
|
||||
return new Size(width, height);
|
||||
}
|
||||
|
||||
private void Measure(IEnumerable<GraphNode> nodes, HashSet<DependencyObject> set)
|
||||
{
|
||||
set ??= new HashSet<DependencyObject>();
|
||||
|
||||
Reference in new issue
Block a user