From 5571430e1bed9aed28fc3124be38db640c9b715e Mon Sep 17 00:00:00 2001 From: Menotdan <32620310+Menotdan@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:50:02 -0400 Subject: [PATCH] Move options out of VisjectSurface.Input to a different place. --- Source/Editor/Surface/VisjectSurface.Input.cs | 11 ----------- Source/Editor/Surface/VisjectSurface.cs | 6 ++++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Source/Editor/Surface/VisjectSurface.Input.cs b/Source/Editor/Surface/VisjectSurface.Input.cs index 5ba070200..462abe54e 100644 --- a/Source/Editor/Surface/VisjectSurface.Input.cs +++ b/Source/Editor/Surface/VisjectSurface.Input.cs @@ -18,18 +18,11 @@ namespace FlaxEditor.Surface /// public readonly InputActionsContainer InputActions; - /// - /// Should grid snapping be enabled for these nodes? - /// - public bool GridSnappingEnabled = false; - private string _currentInputText = string.Empty; private Float2 _movingNodesDelta; private Float2 _gridRoundingDelta; private HashSet _movingNodes; private readonly Stack _inputBrackets = new Stack(); - private readonly float _gridSize = 15f; - private class InputBracket { @@ -254,10 +247,6 @@ namespace FlaxEditor.Surface if ((!GridSnappingEnabled || Math.Abs(delta.X) >= _gridSize || (Math.Abs(delta.Y) >= _gridSize)) && deltaLengthSquared > 0.01f) { - // Move selected nodes - Debug.Log("test " + delta.ToString() + ", " + _gridSize.ToString() + ", " + _targetScale.ToString()); - - // The change that occurred by rounding. Used to retain specific delta values if it doesn't snap on one axis but does on another. if (GridSnappingEnabled) { Float2 unroundedDelta = delta; diff --git a/Source/Editor/Surface/VisjectSurface.cs b/Source/Editor/Surface/VisjectSurface.cs index 22aba4855..7cfcecbfc 100644 --- a/Source/Editor/Surface/VisjectSurface.cs +++ b/Source/Editor/Surface/VisjectSurface.cs @@ -30,6 +30,12 @@ namespace FlaxEditor.Surface /// protected SurfaceRootControl _rootControl; + /// + /// Is grid snapping enabled for this surface? + /// + public bool GridSnappingEnabled = false; + + private readonly float _gridSize = 15f; private float _targetScale = 1.0f; private float _moveViewWithMouseDragSpeed = 1.0f; private bool _canEdit = true;