Skip to content

Commit afe134d

Browse files
Fix potential resize issue whenAttachedCardShadow.InnerContentClipMode == CompositionGeometricClip
1 parent bb048b4 commit afe134d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ protected override void SetElementChildVisual(AttachedShadowElementContext conte
293293
else
294294
{
295295
base.SetElementChildVisual(context);
296+
297+
// Reset context.SpriteVisual.Size and RelativeSizeAdjustment to default values
298+
// as they may be changed in the block above.
299+
context.SpriteVisual.Size = Vector2.Zero;
300+
context.SpriteVisual.RelativeSizeAdjustment = Vector2.One;
301+
296302
context.RemoveAndDisposeResource(OpacityMaskVisualSurfaceResourceKey);
297303
context.RemoveAndDisposeResource(OpacityMaskSurfaceBrushResourceKey);
298304
context.RemoveAndDisposeResource(OpacityMaskVisualResourceKey);
@@ -321,6 +327,7 @@ protected internal override void OnSizeChanged(AttachedShadowElementContext cont
321327
}
322328

323329
UpdateShadowClip(context);
330+
UpdateVisualOpacityMask(context);
324331

325332
base.OnSizeChanged(context, newSize, previousSize);
326333
}

0 commit comments

Comments
 (0)