Skip to content

Commit

Permalink
[Android] Fix shadows size in clipped views (#11603) Fixes #11578
Browse files Browse the repository at this point in the history
* Fix shadows clipping views

* Fix build errors

* Capture and cache Context usage

We've found Context can be a bit expensive to get in a large frequency of calls (#8001), so we can avoid this by capturing and caching the instance.

* Removed duplicated test

* Revert latest changes

---------

Co-authored-by: redth <jondick@gmail.com>
Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
  • Loading branch information
3 people authored Feb 10, 2023
1 parent 8a626f1 commit 5a01dbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/src/Platform/Android/WrapperView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ void DrawShadow(Canvas canvas)
else
{
var bounds = new Graphics.RectF(0, 0, canvas.Width, canvas.Height);
var path = Clip.PathForBounds(bounds)?.AsAndroidPath();
var density = Context.GetDisplayDensity();
var path = Clip.PathForBounds(bounds)?.AsAndroidPath(scaleX: density, scaleY: density);

path.Offset(shadowOffsetX, shadowOffsetY);

Expand Down

0 comments on commit 5a01dbe

Please sign in to comment.