Пример #1
0
        public override Geometry Layout(Constraint c)
        {
            PassInheritedProperties();
            var maxLength = 0;

            foreach (var l in lines)
            {
                if (l.Length > maxLength)
                {
                    maxLength = l.Length;
                }
            }
            Geometry = new Geometry {
                w = LayoutUtils.Clamp(c.xMin, c.xMax, maxLength),
                h = LayoutUtils.Clamp(c.yMin, c.yMax, lines.Length),
            };
            return(Geometry);
        }
Пример #2
0
        public override Geometry Layout(Constraint c)
        {
            PassInheritedProperties();
            var w = LayoutUtils.Clamp(c.xMin, c.xMax, width);

            if (child == null)
            {
                Geometry = new Geometry {
                    w = w,
                    h = c.yMin,
                };
            }
            else
            {
                child.Position = (0, 0);
                Geometry       = child.Layout(c with {
                    xMin = w,
                    xMax = w,
                });
            }
            return(Geometry);
        }
Пример #3
0
        public override Geometry Layout(Constraint c)
        {
            PassInheritedProperties();
            var h = LayoutUtils.Clamp(c.yMin, c.yMax, height);

            if (child == null)
            {
                Geometry = new Geometry {
                    w = c.xMin,
                    h = h,
                };
            }
            else
            {
                child.Position = (0, 0);
                Geometry       = child.Layout(c with {
                    yMin = h,
                    yMax = h,
                });
            }
            return(Geometry);
        }