예제 #1
0
        partial void ApplyNativeClip(Rect rect)
        {
            if (rect.IsEmpty)
            {
                if (_previousClip != rect)
                {
                    _previousClip = rect;

                    ViewCompat.SetClipBounds(this, null);
                }

                return;
            }

            _previousClip = rect;

            var physicalRect = rect.LogicalToPhysicalPixels();

            if (FrameRoundingAdjustment is { } fra)
            {
                physicalRect.Width  += fra.Width;
                physicalRect.Height += fra.Height;
            }

            ViewCompat.SetClipBounds(this, physicalRect);

            SetClipChildren(NeedsClipToSlot);
        }
예제 #2
0
        partial void ApplyNativeClip(Rect rect)
        {
            // Non-UIElements typically expect to be clipped, and display incorrectly otherwise
            // This won't work when UIElements and non-UIElements are mixed in the same Panel,
            // but it should cover most cases in practice, and anyway should be superceded when
            // IFrameworkElement will be removed.
            SetClipChildren(FeatureConfiguration.UIElement.AlwaysClipNativeChildren ? AreChildrenNativeViewsOnly : false);

            if (rect.IsEmpty)
            {
                ViewCompat.SetClipBounds(this, null);
                return;
            }

            var physicalRect = rect.LogicalToPhysicalPixels();

            if (FrameRoundingAdjustment is { } fra)
            {
                physicalRect.Width  += fra.Width;
                physicalRect.Height += fra.Height;
            }

            ViewCompat.SetClipBounds(this, physicalRect);

            SetClipChildren(NeedsClipToSlot);
        }
예제 #3
0
        partial void EnsureClip(Rect rect)
        {
            if (rect.IsEmpty)
            {
                ViewCompat.SetClipBounds(this, null);
                return;
            }

            ViewCompat.SetClipBounds(this, rect.LogicalToPhysicalPixels());
        }
예제 #4
0
        partial void ApplyNativeClip(Rect rect)
        {
            if (rect.IsEmpty)
            {
                ViewCompat.SetClipBounds(this, null);
                return;
            }

            ViewCompat.SetClipBounds(this, rect.LogicalToPhysicalPixels());
            SetClipChildren(NeedsClipToSlot);
        }