File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,15 @@ private bool HitTestAlphaMask(Avalonia.Point point)
2020 {
2121 if ( Source == null ) return false ;
2222
23+ // When ClipToBounds is false on ancestor controls (e.g. LayoutTransformControl,
24+ // Viewbox), Avalonia's hit-test walk can deliver points that are outside this
25+ // Image's arranged bounds. Without this early-out the Math.Min clamp below
26+ // would map them to an edge pixel of the alpha mask, producing false positives
27+ // that steal clicks from neighbouring layout elements.
28+ if ( point . X < 0 || point . Y < 0 ||
29+ point . X >= Bounds . Width || point . Y >= Bounds . Height )
30+ return false ;
31+
2332 var maskEntry = IconUtility . GetAlphaMask ( Source ) ;
2433 // No mask → treat as fully transparent (click-through).
2534 // This is critical for the async image pipeline: placeholder images
Original file line number Diff line number Diff line change 342342 <DataTemplate DataType =" layout:MapPanel" >
343343 <LayoutTransformControl Margin =" {Binding Margin, Converter={x:Static converters:StringToThicknessConverter.Instance}}"
344344 HorizontalAlignment =" {Binding HorizontalAlignment, Converter={x:Static converters:TrivialEnumConverter.Instance}}"
345- VerticalAlignment =" {Binding VerticalAlignment, Converter={x:Static converters:TrivialEnumConverter.Instance}}"
346- ClipToBounds =" True" >
345+ VerticalAlignment =" {Binding VerticalAlignment, Converter={x:Static converters:TrivialEnumConverter.Instance}}" >
347346 <LayoutTransformControl .LayoutTransform>
348347 <ScaleTransform ScaleX =" {Binding EffectiveScale}" ScaleY =" {Binding EffectiveScale}" />
349348 </LayoutTransformControl .LayoutTransform>
You can’t perform that action at this time.
0 commit comments