@ -15,7 +15,7 @@ namespace Avalonia.Android.Platform.Specific.Helpers
internal class AndroidMotionEventsHelper : IDisposable
internal class AndroidMotionEventsHelper : IDisposable
{
{
private static readonly PooledList < RawPointerPoint > s_intermediatePointsPooledList = new ( ClearMode . Never ) ;
private static readonly PooledList < RawPointerPoint > s_intermediatePointsPooledList = new ( ClearMode . Never ) ;
private static readonly float s_r adiansToDegree = ( float ) ( 1 8 0f * Math . PI ) ;
private const float R adiansToDegree = ( float ) ( 1 8 0f * Math . PI ) ;
private readonly TouchDevice _ touchDevice ;
private readonly TouchDevice _ touchDevice ;
private readonly MouseDevice _ mouseDevice ;
private readonly MouseDevice _ mouseDevice ;
private readonly PenDevice _ penDevice ;
private readonly PenDevice _ penDevice ;
@ -223,7 +223,7 @@ namespace Avalonia.Android.Platform.Specific.Helpers
{
{
Position = new Point ( e . GetX ( index ) , e . GetY ( index ) ) / _ view . RenderScaling ,
Position = new Point ( e . GetX ( index ) , e . GetY ( index ) ) / _ view . RenderScaling ,
Pressure = Math . Min ( e . GetPressure ( index ) , 1 ) , // android pressure can depend on the device, can be mixed up with "GetSize", may be larger than 1.0f on some devices
Pressure = Math . Min ( e . GetPressure ( index ) , 1 ) , // android pressure can depend on the device, can be mixed up with "GetSize", may be larger than 1.0f on some devices
Twist = e . GetOrientation ( index ) * s_r adiansToDegree
Twist = e . GetOrientation ( index ) * R adiansToDegree
} ;
} ;
}
}
@ -233,7 +233,7 @@ namespace Avalonia.Android.Platform.Specific.Helpers
{
{
Position = new Point ( e . GetHistoricalX ( index , pos ) , e . GetHistoricalY ( index , pos ) ) / _ view . RenderScaling ,
Position = new Point ( e . GetHistoricalX ( index , pos ) , e . GetHistoricalY ( index , pos ) ) / _ view . RenderScaling ,
Pressure = Math . Min ( e . GetHistoricalPressure ( index , pos ) , 1 ) ,
Pressure = Math . Min ( e . GetHistoricalPressure ( index , pos ) , 1 ) ,
Twist = e . GetHistoricalOrientation ( index , pos ) * s_r adiansToDegree
Twist = e . GetHistoricalOrientation ( index , pos ) * R adiansToDegree
} ;
} ;
}
}