Use in over ref modifier in Math functions input parameters
This commit is contained in:
@@ -96,7 +96,7 @@ namespace FlaxEditor.GUI
|
||||
private void DoDrag()
|
||||
{
|
||||
// Do the drag drop operation if has selected element
|
||||
if (new Rectangle(Float2.Zero, Size).Contains(ref _mouseDownPos))
|
||||
if (new Rectangle(Float2.Zero, Size).Contains(_mouseDownPos))
|
||||
{
|
||||
if (Validator.SelectedAsset != null)
|
||||
DoDragDrop(DragAssets.GetDragData(Validator.SelectedAsset));
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace FlaxEditor.GUI
|
||||
for (int i = 0; i < children.Count; i++)
|
||||
{
|
||||
if (children[i] is KeyframePoint p)
|
||||
p.IsSelected = p.Bounds.Intersects(ref selectionRect);
|
||||
p.IsSelected = p.Bounds.Intersects(selectionRect);
|
||||
}
|
||||
_editor.UpdateTangents();
|
||||
}
|
||||
@@ -85,7 +85,7 @@ namespace FlaxEditor.GUI
|
||||
internal void OnMove(Float2 location)
|
||||
{
|
||||
// Skip updating keyframes until move actual starts to be meaningful
|
||||
if (Float2.Distance(ref _movingSelectionStartPosLock, ref location) < 1.5f)
|
||||
if (Float2.Distance(_movingSelectionStartPosLock, location) < 1.5f)
|
||||
return;
|
||||
_movingSelectionStartPosLock = Float2.Minimum;
|
||||
|
||||
|
||||
@@ -689,8 +689,8 @@ namespace FlaxEditor.GUI
|
||||
if (selectedOnly && !point.IsSelected)
|
||||
continue;
|
||||
var pos = point.Point;
|
||||
Float2.Min(ref posMin, ref pos, out posMin);
|
||||
Float2.Max(ref posMax, ref pos, out posMax);
|
||||
Float2.Min(posMin, pos, out posMin);
|
||||
Float2.Max(posMax, pos, out posMax);
|
||||
}
|
||||
|
||||
// Apply margin around the area
|
||||
@@ -703,16 +703,16 @@ namespace FlaxEditor.GUI
|
||||
PointFromKeyframesToContents(ref posMin, ref viewRect);
|
||||
PointFromKeyframesToContents(ref posMax, ref viewRect);
|
||||
var tmp = posMin;
|
||||
Float2.Min(ref posMin, ref posMax, out posMin);
|
||||
Float2.Max(ref posMax, ref tmp, out posMax);
|
||||
Float2.Min(posMin, posMax, out posMin);
|
||||
Float2.Max(posMax, tmp, out posMax);
|
||||
var contentsSize = posMax - posMin;
|
||||
|
||||
// Convert from Contents to Main Panel
|
||||
posMin = _contents.PointToParent(posMin);
|
||||
posMax = _contents.PointToParent(posMax);
|
||||
tmp = posMin;
|
||||
Float2.Min(ref posMin, ref posMax, out posMin);
|
||||
Float2.Max(ref posMax, ref tmp, out posMax);
|
||||
Float2.Min(posMin, posMax, out posMin);
|
||||
Float2.Max(posMax, tmp, out posMax);
|
||||
|
||||
// Update zoom (leave unchanged when focusing a single point)
|
||||
var zoomMask = EnableZoom;
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace FlaxEditor.GUI.Input
|
||||
Focus();
|
||||
float mousePosition = location.X;
|
||||
|
||||
if (_thumbRect.Contains(ref location))
|
||||
if (_thumbRect.Contains(location))
|
||||
{
|
||||
// Start sliding
|
||||
_isSliding = true;
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
var k = keyframes[i];
|
||||
|
||||
var sphere = new BoundingSphere(k.Value, KeyframeSize);
|
||||
if (sphere.Intersects(ref selectRay))
|
||||
if (sphere.Intersects(selectRay))
|
||||
{
|
||||
SelectKeyframe(_track, i, 0);
|
||||
return;
|
||||
@@ -154,7 +154,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
{
|
||||
var t = k.Value + k.TangentIn;
|
||||
var box = BoundingBox.FromSphere(new BoundingSphere(t, TangentSize));
|
||||
if (box.Intersects(ref selectRay))
|
||||
if (box.Intersects(selectRay))
|
||||
{
|
||||
SelectKeyframe(_track, i, 1);
|
||||
return;
|
||||
@@ -165,7 +165,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
{
|
||||
var t = k.Value + k.TangentOut;
|
||||
var box = BoundingBox.FromSphere(new BoundingSphere(t, TangentSize));
|
||||
if (box.Intersects(ref selectRay))
|
||||
if (box.Intersects(selectRay))
|
||||
{
|
||||
SelectKeyframe(_track, i, 2);
|
||||
return;
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace FlaxEditor.GUI.Timeline.GUI
|
||||
/// <inheritdoc />
|
||||
public override void OnMouseMove(Float2 location)
|
||||
{
|
||||
if (_isMoving && Float2.DistanceSquared(ref location, ref _startMovePos) > 25.0f)
|
||||
if (_isMoving && Float2.DistanceSquared(location, _startMovePos) > 25.0f)
|
||||
{
|
||||
_startMovePos = Float2.Minimum;
|
||||
var x = PointToParent(location).X;
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace FlaxEditor.GUI
|
||||
{
|
||||
if (Children[i] is KeyframePoint p)
|
||||
{
|
||||
p.IsSelected = p.Bounds.Intersects(ref selectionRect);
|
||||
p.IsSelected = p.Bounds.Intersects(selectionRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -401,7 +401,7 @@ namespace FlaxEditor.GUI
|
||||
Cursor = CursorType.Default;
|
||||
|
||||
// Check if no move has been made at all
|
||||
if (Float2.Distance(ref location, ref _rightMouseDownPos) < 2.0f)
|
||||
if (Float2.Distance(location, _rightMouseDownPos) < 2.0f)
|
||||
{
|
||||
var selectionCount = _editor.SelectionCount;
|
||||
var point = GetChildAt(location) as KeyframePoint;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace FlaxEditor.GUI.Timeline.GUI
|
||||
var color = (_timeline.IsMovingPositionHandle ? style.SelectionBorder : style.Foreground).AlphaMultiplied(0.6f);
|
||||
Matrix3x3.RotationZ(Mathf.PiOverTwo, out var m1);
|
||||
var m2 = Matrix3x3.Translation2D(0, timeAxisHeaderOffset);
|
||||
Matrix3x3.Multiply(ref m1, ref m2, out var m3);
|
||||
Matrix3x3.Multiply(m1, m2, out var m3);
|
||||
Render2D.PushTransform(m3);
|
||||
// TODO: Convert to its own sprite or 9 slice
|
||||
Render2D.DrawSprite(icon, new Rectangle(new Float2(10, -icon.Size.X * 0.5f - 1), Size + new Float2(0, 1)), color);
|
||||
|
||||
@@ -356,7 +356,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
{
|
||||
Render2D.DrawLine(bounds.UpperLeft, bounds.BottomLeft, moveColor, moveThickness);
|
||||
}
|
||||
else if (IsMouseOver && CanResize && MoveLeftEdgeRect.Contains(ref _mouseLocation))
|
||||
else if (IsMouseOver && CanResize && MoveLeftEdgeRect.Contains(_mouseLocation))
|
||||
{
|
||||
Render2D.DrawLine(bounds.UpperLeft, bounds.BottomLeft, Color.Yellow);
|
||||
}
|
||||
@@ -364,7 +364,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
{
|
||||
Render2D.DrawLine(bounds.UpperRight, bounds.BottomRight, moveColor, moveThickness);
|
||||
}
|
||||
else if (IsMouseOver && CanResize && MoveRightEdgeRect.Contains(ref _mouseLocation))
|
||||
else if (IsMouseOver && CanResize && MoveRightEdgeRect.Contains(_mouseLocation))
|
||||
{
|
||||
Render2D.DrawLine(bounds.UpperRight, bounds.BottomRight, Color.Yellow);
|
||||
}
|
||||
@@ -384,8 +384,8 @@ namespace FlaxEditor.GUI.Timeline
|
||||
_startMoveLocation = Root.MousePosition;
|
||||
_startMoveStartFrame = StartFrame;
|
||||
_startMoveDuration = DurationFrames;
|
||||
_startMoveLeftEdge = MoveLeftEdgeRect.Contains(ref location) && CanResize;
|
||||
_startMoveRightEdge = MoveRightEdgeRect.Contains(ref location) && CanResize;
|
||||
_startMoveLeftEdge = MoveLeftEdgeRect.Contains(location) && CanResize;
|
||||
_startMoveRightEdge = MoveRightEdgeRect.Contains(location) && CanResize;
|
||||
StartMouseCapture(true);
|
||||
if (_startMoveLeftEdge || _startMoveRightEdge)
|
||||
return true;
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
DebugDraw.DrawSphere(sphere, selected ? Color.Yellow : Color.Red);
|
||||
sphere.Radius *= 0.95f;
|
||||
DebugDraw.DrawSphere(sphere, new Color(1, 0, 0, coveredAlpha), 0, false);
|
||||
if (select && sphere.Intersects(ref selectRay))
|
||||
if (select && sphere.Intersects(selectRay))
|
||||
SelectKeyframeGizmo(curveTrack, i, 0);
|
||||
|
||||
if (!k.TangentIn.IsZero)
|
||||
@@ -349,7 +349,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
var box = BoundingBox.FromSphere(new BoundingSphere(t, EditCurveTrackGizmo.TangentSize));
|
||||
DebugDraw.DrawBox(box, selected ? Color.Yellow : Color.AliceBlue);
|
||||
DebugDraw.DrawBox(box, Color.AliceBlue.AlphaMultiplied(coveredAlpha), 0, false);
|
||||
if (select && box.Intersects(ref selectRay))
|
||||
if (select && box.Intersects(selectRay))
|
||||
SelectKeyframeGizmo(curveTrack, i, 2);
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
var box = BoundingBox.FromSphere(new BoundingSphere(t, EditCurveTrackGizmo.TangentSize));
|
||||
DebugDraw.DrawBox(box, selected ? Color.Yellow : Color.AliceBlue);
|
||||
DebugDraw.DrawBox(box, Color.AliceBlue.AlphaMultiplied(coveredAlpha), 0, false);
|
||||
if (select && box.Intersects(ref selectRay))
|
||||
if (select && box.Intersects(selectRay))
|
||||
SelectKeyframeGizmo(curveTrack, i, 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -2078,7 +2078,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
if (button == MouseButton.Right && _isRightMouseButtonDown)
|
||||
{
|
||||
_isRightMouseButtonDown = false;
|
||||
if (Float2.Distance(ref location, ref _rightMouseButtonDownPos) < 4.0f)
|
||||
if (Float2.Distance(location, _rightMouseButtonDownPos) < 4.0f)
|
||||
ShowContextMenu(location);
|
||||
}
|
||||
|
||||
@@ -2243,7 +2243,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
|
||||
foreach (var media in _tracks[i].Media)
|
||||
{
|
||||
if (media.Bounds.Intersects(ref mediaRect))
|
||||
if (media.Bounds.Intersects(mediaRect))
|
||||
{
|
||||
SelectedMedia.Add(media);
|
||||
selectionChanged = true;
|
||||
|
||||
@@ -810,7 +810,7 @@ namespace FlaxEditor.GUI.Timeline
|
||||
/// <returns>True if hits it.</returns>
|
||||
protected virtual bool TestHeaderHit(ref Float2 location)
|
||||
{
|
||||
return new Rectangle(0, 0, Width, HeaderHeight).Contains(ref location);
|
||||
return new Rectangle(0, 0, Width, HeaderHeight).Contains(location);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
// Hit-test dot
|
||||
var size = Height - 2.0f;
|
||||
var rect = new Rectangle(new Float2(size * -0.5f) + Size * 0.5f, new Float2(size));
|
||||
return rect.Contains(ref location);
|
||||
return rect.Contains(location);
|
||||
}
|
||||
|
||||
return base.ContainsPoint(ref location, precise);
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace FlaxEditor.GUI.Tree
|
||||
}
|
||||
|
||||
var nodeArea = new Rectangle(pos, child.Size);
|
||||
if (child.IsExpanded && range.Intersects(ref nodeArea))
|
||||
if (child.IsExpanded && range.Intersects(nodeArea))
|
||||
WalkSelectRangeExpandedTree(selection, child, ref range);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ namespace FlaxEditor.GUI.Tree
|
||||
/// <returns>True if hits it.</returns>
|
||||
protected virtual bool TestHeaderHit(ref Float2 location)
|
||||
{
|
||||
return _headerRect.Contains(ref location);
|
||||
return _headerRect.Contains(location);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -871,7 +871,7 @@ namespace FlaxEditor.GUI.Tree
|
||||
|
||||
static Rectangle GetChildGlobalRectangle(Control control, ref Matrix3x3 globalTransform)
|
||||
{
|
||||
Matrix3x3.Multiply(ref control._cachedTransform, ref globalTransform, out var globalChildTransform);
|
||||
Matrix3x3.Multiply(control._cachedTransform, globalTransform, out var globalChildTransform);
|
||||
return new Rectangle(globalChildTransform.M31, globalChildTransform.M32, control.Width * globalChildTransform.M11, control.Height * globalChildTransform.M22);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user