Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-6836 Arrange call crash guard #15319

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions src/DynamoCoreWpf/UI/InOutPortPanel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -26,14 +26,21 @@ protected override Size ArrangeOverride(Size arrangeSize)
double x = 0, y = 0;
foreach (UIElement child in this.Children)
{
var portVm = generator.ItemFromContainer(child) as PortViewModel;
var lineIndex = portVm.PortModel.LineIndex;
var multiplier = ((lineIndex == -1) ? itemIndex : lineIndex);
var portHeight = portVm.PortModel.Height;
try
{
var portVm = generator.ItemFromContainer(child) as PortViewModel;
var lineIndex = portVm.PortModel.LineIndex;
var multiplier = ((lineIndex == -1) ? itemIndex : lineIndex);
var portHeight = portVm.PortModel.Height;

y = multiplier * portHeight;
child.Arrange(new Rect(x, y, arrangeSize.Width, portHeight));
itemIndex = itemIndex + 1;
y = multiplier * portHeight;
child.Arrange(new Rect(x, y, arrangeSize.Width, portHeight));
itemIndex = itemIndex + 1;
}
catch (Exception ex)
{
Analytics.TrackException(ex, true);
}
}

return base.ArrangeOverride(arrangeSize);
Expand Down
Loading