示例#1
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            var strokeThickness = ActualStrokeThickness;

            var childRect = new Rect(
                strokeThickness / 2,
                strokeThickness / 2,
                finalSize.Width - strokeThickness,
                finalSize.Height - strokeThickness
                );

            _rectangle.Arrange(childRect);
            _rectangle.SetAttribute(
                ("x", childRect.X.ToStringInvariant()),
                ("y", childRect.Y.ToStringInvariant()),
                ("width", childRect.Width.ToStringInvariant()),
                ("height", childRect.Height.ToStringInvariant())
                );

            _rectangle.Clip = new RectangleGeometry()
            {
                Rect = new Rect(0, 0, finalSize.Width, finalSize.Height)
            };

            return(finalSize);
        }
示例#2
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            var childRect = new Rect(
                ActualStrokeThickness / 2,
                ActualStrokeThickness / 2,
                finalSize.Width - ActualStrokeThickness,
                finalSize.Height - ActualStrokeThickness
                );

            _rectangle.Arrange(childRect);
            _rectangle.SetAttribute(
                ("x", childRect.X.ToStringInvariant()),
                ("y", childRect.Y.ToStringInvariant()),
                ("width", childRect.Width.ToStringInvariant()),
                ("height", childRect.Height.ToStringInvariant())
                );

            return(finalSize);
        }
示例#3
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            var strokeThickness = ActualStrokeThickness;

            var childRect = new Rect(
                strokeThickness / 2,
                strokeThickness / 2,
                finalSize.Width - strokeThickness,
                finalSize.Height - strokeThickness
                )
                            .AtLeast(new Size(0, 0));

            _rectangle.Arrange(childRect);

            Uno.UI.Xaml.WindowManagerInterop.SetSvgElementRect(_rectangle.HtmlId, childRect);

            _rectangle.Clip = new RectangleGeometry()
            {
                Rect = new Rect(0, 0, finalSize.Width, finalSize.Height)
            };

            return(finalSize);
        }