diff --git a/src/Uno.UI.Toolkit/ElevatedView.Android.cs b/src/Uno.UI.Toolkit/ElevatedView.Android.cs index 9e3999132f32..fa8771f03e92 100644 --- a/src/Uno.UI.Toolkit/ElevatedView.Android.cs +++ b/src/Uno.UI.Toolkit/ElevatedView.Android.cs @@ -69,12 +69,13 @@ private void DrawShadow(AndroidCanvas canvas) { var viewHeight = ActualHeight; var viewWidth = ActualWidth; + var scaleFactor = GetScaleFactorForLayoutRounding(); // If bounds is zero if (viewHeight != 0 && viewWidth != 0) { - var bitmapHeight = viewHeight + MaximumRadius; - var bitmapWidth = viewWidth + MaximumRadius; + var bitmapHeight = (viewHeight + MaximumRadius) * scaleFactor; + var bitmapWidth = (viewWidth + MaximumRadius) * scaleFactor; // Reset bitmap to bounds _shadowBitmap = AndroidBitmap.CreateBitmap( @@ -109,8 +110,8 @@ private void DrawShadow(AndroidCanvas canvas) _shadowPaint.SetMaskFilter(new BlurMaskFilter(radius, BlurMaskFilter.Blur.Normal)); } - float shadowOffsetX = (float)Elevation * x; - float shadowOffsetY = (float)Elevation * y; + float shadowOffsetX = (float)(Elevation * x * scaleFactor); + float shadowOffsetY = (float)(Elevation * y * scaleFactor); _shadowCanvas.DrawBitmap(extractAlpha!, (int)shadowOffsetX, (int)shadowOffsetY, _shadowPaint);