Cleanup 5

This commit is contained in:
W2.Wizard
2021-02-21 11:50:30 +01:00
parent ee76440477
commit 694b20148d
30 changed files with 93 additions and 103 deletions

View File

@@ -32,8 +32,11 @@ namespace FlaxEngine.GUI
private bool IntersectsChildContent(CanvasRootControl child, ref Ray ray, out Vector2 childSpaceLocation)
{
// Inline bounds calculations (it will reuse world matrix)
OrientedBoundingBox bounds = new OrientedBoundingBox();
bounds.Extents = new Vector3(child.Size * 0.5f, Mathf.Epsilon);
OrientedBoundingBox bounds = new OrientedBoundingBox
{
Extents = new Vector3(child.Size * 0.5f, Mathf.Epsilon)
};
child.Canvas.GetWorldMatrix(out var world);
Matrix.Translation(bounds.Extents.X, bounds.Extents.Y, 0, out var offset);
Matrix.Multiply(ref offset, ref world, out bounds.Transformation);

View File

@@ -64,8 +64,10 @@ namespace FlaxEngine.GUI
VScrollBar = GetChild<VScrollBar>();
if (VScrollBar == null)
{
VScrollBar = new VScrollBar(this, Width - ScrollBar.DefaultSize, Height);
VScrollBar.AnchorPreset = AnchorPresets.TopLeft;
VScrollBar = new VScrollBar(this, Width - ScrollBar.DefaultSize, Height)
{
AnchorPreset = AnchorPresets.TopLeft
};
//VScrollBar.X += VScrollBar.Width;
VScrollBar.ValueChanged += () => SetViewOffset(Orientation.Vertical, VScrollBar.Value);
}
@@ -82,8 +84,10 @@ namespace FlaxEngine.GUI
HScrollBar = GetChild<HScrollBar>();
if (HScrollBar == null)
{
HScrollBar = new HScrollBar(this, Height - ScrollBar.DefaultSize, Width);
HScrollBar.AnchorPreset = AnchorPresets.TopLeft;
HScrollBar = new HScrollBar(this, Height - ScrollBar.DefaultSize, Width)
{
AnchorPreset = AnchorPresets.TopLeft
};
//HScrollBar.Y += HScrollBar.Height;
//HScrollBar.Offsets += new Margin(0, 0, HScrollBar.Height * 0.5f, 0);
HScrollBar.ValueChanged += () => SetViewOffset(Orientation.Horizontal, HScrollBar.Value);