Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,17 @@ protected override void OnPointerReleased(PointerReleasedEventArgs e)
return;
}

// ── Left-button release: end element resize ──────────────────────
if (_resizing is not null)
{
_resizing.CommitResize();
_resizing = null;
e.Pointer.Capture(null);
InvalidateAndMeasure();
e.Handled = true;
return;
}

// ── Left-button release: end element drag ─────────────────────────
if (_dragging is null) return;
if (_vm is null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,22 @@ private void RenderLinks(DrawingContext ctx)
// or whose destination node is inlined (value shown in hook row instead).
if (link.Destination is null) continue;
if (link.Destination is NodeViewModel destNvm && destNvm.IsInlined) continue;

// Check if the destination's underlying model belongs to the current boundary.
// Using ContainedWithin (rather than collection membership) keeps undo working:
// after an undo the boundary manager creates a fresh ViewModel for the returned
// node, so the stale VM in link.Destination is no longer in the Nodes collection
// but its UnderlyingNode.ContainedWithin is updated back to the current boundary.
bool destinationInCurrentView = link.Destination switch
{
NodeViewModel nvm => nvm.UnderlyingNode.ContainedWithin == _vm.CurrentBoundary,
StartViewModel svm => svm.UnderlyingStart.ContainedWithin == _vm.CurrentBoundary,
GhostNodeViewModel gvm => gvm.UnderlyingGhostNode.ContainedWithin == _vm.CurrentBoundary,
FunctionInstanceViewModel fivm => fivm.UnderlyingInstance.ContainedWithin == _vm.CurrentBoundary,
FunctionParameterViewModel fpvm => fpvm.UnderlyingParameter.ContainedWithin == _vm.CurrentBoundary,
_ => false
};
if (!destinationInCurrentView) continue;

bool isDisabled = link.UnderlyingLink.IsDisabled;
var brush = link.IsSelected
Expand Down
5 changes: 5 additions & 0 deletions src/XTMF2.GUI/Views/TypePickerDialog.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ public TypePickerDialog(
{
TypeListBox.SelectedIndex = idx;
TypeListBox.ScrollIntoView(TypeListBox.SelectedItem!);
// Explicitly call OnListSelectionChanged to ensure CanOK is updated.
// This is needed because if the item is already at the selected index,
// SelectionChanged won't fire.
OnListSelectionChanged();
}
}
};
Expand Down Expand Up @@ -357,6 +361,7 @@ private void UpdateFilter()

FilteredTypes = new ObservableCollection<Type>(source);
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(HasNoResults)));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CanOK)));

// Keep the list box in sync — auto-select first match.
if (FilteredTypes.Count > 0)
Expand Down
Loading