fix(brand): one logo, not two — and hit-testing follows what you see
The brand exemption for the universal blur put a BrandLogoOverlay above the blur host while the canvas ItemsControl kept drawing the same element, so two logos sat on top of each other. - The canvas presenter for a brand logo is collapsed: BrandLogoOverlay is the only render, and it now carries the element's Opacity so the canvas copy is not missed. - Hit-testing follows the eye: a click inside the logo's bounds selects the logo, because it is the topmost layer in the compositor too. Without that you saw the logo on top and grabbed the webcam underneath it. - SelectedLayerPreviewHitTestingTests updated to the new contract (collapsed presenter, logo wins its bounds, list selection still works). 3 tests pass; Release 0 warnings.
This commit is contained in:
@@ -90,6 +90,15 @@
|
||||
<Style TargetType="ContentPresenter">
|
||||
<Setter Property="Canvas.Left" Value="{Binding X}"/>
|
||||
<Setter Property="Canvas.Top" Value="{Binding Y}"/>
|
||||
<!-- ⛔ The brand logo renders ONCE, in BrandLogoOverlay above
|
||||
the blur host, so it can never be blurred. Drawing it here
|
||||
as well stacked two copies on top of each other
|
||||
(creator report, 2026-11-01). -->
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsBrandLogo}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
<ItemsControl.ItemTemplate>
|
||||
@@ -476,6 +485,7 @@
|
||||
<Image Canvas.Left="{Binding StagedBrandLogo.X}" Canvas.Top="{Binding StagedBrandLogo.Y}"
|
||||
Width="{Binding StagedBrandLogo.Width}" Height="{Binding StagedBrandLogo.Height}"
|
||||
Source="{Binding StagedBrandLogo.DisplaySource}" Stretch="Fill"
|
||||
Opacity="{Binding StagedBrandLogo.Opacity}"
|
||||
IsHitTestVisible="False"
|
||||
Visibility="{Binding StagedBrandLogo, Converter={StaticResource NotNullToVis}}"/>
|
||||
</Canvas>
|
||||
|
||||
@@ -677,6 +677,13 @@ public partial class PreviewPane : UserControl
|
||||
if (vm.SelectedElement is { } selected && IsHitTestable(selected) && Contains(selected, p))
|
||||
return selected;
|
||||
|
||||
// The brand logo is drawn ABOVE everything (the compositor blits it after the blur group,
|
||||
// and the preview renders it in BrandLogoOverlay), so a click inside it must select it —
|
||||
// otherwise you see the logo on top and grab the webcam underneath it.
|
||||
var brand = vm.StagedBrandLogo;
|
||||
if (brand is { IsVisible: true } && Contains(brand, p))
|
||||
return brand;
|
||||
|
||||
for (var i = scene.Elements.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var element = scene.Elements[i];
|
||||
|
||||
Reference in New Issue
Block a user