Skip to content

Commit 891fa5c

Browse files
Fix resize issue when AttachedCardShadow.InnerContentClipMode == CompositionMaskBrush
1 parent afe134d commit 891fa5c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Microsoft.Toolkit.Uwp.UI.Media/Shadows/AttachedCardShadow.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,16 @@ protected internal override void OnSizeChanged(AttachedShadowElementContext cont
326326
shapeVisual.Size = sizeAsVec2;
327327
}
328328

329+
if (context.TryGetResource(OpacityMaskVisualSurfaceResourceKey, out CompositionVisualSurface opacityMaskVisualSurface))
330+
{
331+
opacityMaskVisualSurface.SourceSize = sizeAsVec2 + new Vector2(MaxBlurRadius * 2);
332+
}
333+
334+
if (InnerContentClipMode is InnerContentClipMode.CompositionMaskBrush)
335+
{
336+
context.SpriteVisual.Size = sizeAsVec2;
337+
}
338+
329339
UpdateShadowClip(context);
330340
UpdateVisualOpacityMask(context);
331341

0 commit comments

Comments
 (0)