Fix: Elements scrollbar click no longer deselects the selected element

The scrollbar lives inside the ScrollViewer, not the StackPanel
(ElementsPanel). Window_PreviewMouseLeftButtonDown was checking
IsDescendantOf against ElementsPanel, so scrollbar clicks fell through
and nulled SelectedElement. Now checks ElementsScrollViewer instead.

1a of 7-issue polish batch. 207 tests, 0 warnings.
This commit is contained in:
2026-08-18 07:00:51 -07:00
parent c7d4b3b6d9
commit b101d336d0
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -366,7 +366,7 @@
Visibility="{Binding SelectedElement, Converter={StaticResource NotNullToVis}}">
<TextBlock Text="ELEMENTS" Style="{StaticResource SectionHeader}" VerticalAlignment="Center"/>
</StackPanel>
<ScrollViewer Grid.Row="7" VerticalScrollBarVisibility="Auto" Background="Transparent"
<ScrollViewer x:Name="ElementsScrollViewer" Grid.Row="7" VerticalScrollBarVisibility="Auto" Background="Transparent"
Visibility="{Binding SelectedElement, Converter={StaticResource NotNullToVis}}">
<StackPanel x:Name="ElementsPanel" Margin="0,4,0,0">
<!-- Opacity + mirror/shape (draggable elements: image, webcam) -->