Browse Source
Incorrect reset of a captured control when moving the pointer over a MenuItem (#13046 )
* fixed incorrect reset of a captured control when moving the pointer over a MenuItem
* format code
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
revert-13066-fixes/13064-logical-scrollable
viordash
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
7 deletions
src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs
@ -9,6 +9,7 @@ using Avalonia.Platform;
using Avalonia.Reactive ;
using Avalonia.Rendering ;
using Avalonia.Threading ;
using Avalonia.VisualTree ;
namespace Avalonia.Controls.Platform
{
@ -148,16 +149,15 @@ namespace Avalonia.Controls.Platform
if ( item = = null )
return ;
var serverTransform = item ? . CompositionVisual ? . Try GetServerGlobal Transform( ) ;
if ( serverTransform = = null )
var transformedBounds = item . GetTransformedBounds ( ) ;
if ( transformedBounds = = null )
return ;
var point = e . GetCurrentPoint ( null ) ;
var transformedPoint = point . Position . Transform ( serverTransform . Value ) ;
if ( point . Properties . IsLeftButtonPressed & &
new Rect ( item ! . Bounds . Size ) . Contains ( transformedPoint ) = = false )
if ( point . Properties . IsLeftButtonPressed
& & transformedBounds . Value . Contains ( point . Position ) = = false )
{
e . Pointer . Capture ( null ) ;
}