19 internal override void Update()
21 if (Changed && Host.Children.Count > 0)
23 Host.InvokeOnLayoutUpdated();
32 if (c.
Relative.Left.HasValue) x = c.Relative.Left.Value * Host.
Real.Width;
33 if (c.
CrossRelative.Left.HasValue) x = c.CrossRelative.Left.Value * Host.
Real.Height;
36 if (c.RelativeMin.Left.HasValue) x = Math.Max(x, c.RelativeMin.Left.Value * Host.
Real.Width);
37 if (c.AbsoluteMin.Left.HasValue) x = Math.Max(x, c.AbsoluteMin.Left.Value);
39 if (c.RelativeMax.Left.HasValue) x = Math.Min(x, c.RelativeMax.Left.Value * Host.
Real.Width);
40 if (c.AbsoluteMax.Left.HasValue) x = Math.Min(x, c.AbsoluteMax.Left.Value);
44 if (c.
Relative.Top.HasValue) y = c.Relative.Top.Value * Host.
Real.Height;
45 if (c.
CrossRelative.Top.HasValue) y = c.CrossRelative.Top.Value * Host.
Real.Width;
48 if (c.RelativeMin.Top.HasValue) y = Math.Max(y, c.RelativeMin.Top.Value * Host.
Real.Height);
49 if (c.AbsoluteMin.Top.HasValue) y = Math.Max(y, c.AbsoluteMin.Top.Value);
51 if (c.RelativeMax.Top.HasValue) y = Math.Min(y, c.RelativeMax.Top.Value * Host.
Real.Height);
52 if (c.AbsoluteMax.Top.HasValue) y = Math.Min(y, c.AbsoluteMax.Top.Value);
56 if (c.
Relative.Width.HasValue) w = c.Relative.Width.Value * Host.
Real.Width;
57 if (c.
CrossRelative.Width.HasValue) w = c.CrossRelative.Width.Value * Host.
Real.Height;
60 if (c.RelativeMin.Width.HasValue) w = Math.Max(w, c.RelativeMin.Width.Value * Host.
Real.Width);
61 if (c.AbsoluteMin.Width.HasValue) w = Math.Max(w, c.AbsoluteMin.Width.Value);
65 if (c.RelativeMax.Width.HasValue) w = Math.Min(w, c.RelativeMax.Width.Value * Host.
Real.Width);
66 if (c.AbsoluteMax.Width.HasValue) w = Math.Min(w, c.AbsoluteMax.Width.Value);
70 if (c.
Relative.Height.HasValue) h = c.Relative.Height.Value * Host.
Real.Height;
71 if (c.
CrossRelative.Height.HasValue) h = c.CrossRelative.Height.Value * Host.
Real.Width;
74 if (c.RelativeMin.Height.HasValue) h = Math.Max(h, c.RelativeMin.Height.Value * Host.
Real.Height);
75 if (c.AbsoluteMin.Height.HasValue) h = Math.Max(h, c.AbsoluteMin.Height.Value);
80 if (c.RelativeMax.Height.HasValue) h = Math.Min(h, c.RelativeMax.Height.Value * Host.
Real.Height);
81 if (c.AbsoluteMax.Height.HasValue) h = Math.Min(h, c.AbsoluteMax.Height.Value);
84 (w, h) = c.AmIOkWithThisSize(
new Vector2(w, h));
104 real = offset.Transform(real);
107 real = real.Shift(Host.
Real.Position);
110 c.SetReal(real,
"Simple Layout update");
117 internal override void ResizeToContent()
121 float rightmostRight = 0;
124 if (c.
Ghost.X)
continue;
130 if (c.AbsoluteMin.Left.HasValue) x = Math.Max(x, c.AbsoluteMin.Left.Value);
131 if (c.AbsoluteMax.Left.HasValue) x = Math.Min(x, c.AbsoluteMax.Left.Value);
134 if (c.AbsoluteMin.Width.HasValue) w = Math.Max(w, c.AbsoluteMin.Width.Value);
136 if (c.AbsoluteMax.Width.HasValue) w = Math.Min(w, c.AbsoluteMax.Width.Value);
138 rightmostRight = Math.Max(rightmostRight, x + w);
141 Host.SetForcedMinSize(Host.
ForcedMinSize with { X = rightmostRight });
146 float bottommostBottom = 0;
149 if (c.
Ghost.Y)
continue;
155 if (c.AbsoluteMin.Top.HasValue) y = Math.Max(y, c.AbsoluteMin.Top.Value);
156 if (c.AbsoluteMax.Top.HasValue) y = Math.Min(y, c.AbsoluteMax.Top.Value);
159 if (c.AbsoluteMin.Height.HasValue) h = Math.Max(h, c.AbsoluteMin.Height.Value);
161 if (c.AbsoluteMax.Height.HasValue) h = Math.Min(h, c.AbsoluteMax.Height.Value);
163 bottommostBottom = Math.Max(bottommostBottom, y + h);
166 Host.SetForcedMinSize(Host.
ForcedMinSize with { Y = bottommostBottom });
169 base.ResizeToContent();