Browse Source

Removed white spaces and unnecessary if statement

raheelx 9 years ago
parent
commit
0e12380217

+ 14 - 17
Source/AtomicEditor/Editors/SceneEditor3D/Gizmo3D.cpp

@@ -38,9 +38,9 @@ namespace AtomicEditor
 {
 {
 
 
 
 
-	Gizmo3D::Gizmo3D(Context* context) : Object(context),
-		dragging_(false),
-		cloning_(false)
+    Gizmo3D::Gizmo3D(Context* context) : Object(context),
+        dragging_(false),
+        cloning_(false)
 {
 {
     ResourceCache* cache = GetSubsystem<ResourceCache>();
     ResourceCache* cache = GetSubsystem<ResourceCache>();
 
 
@@ -185,16 +185,16 @@ void Gizmo3D::Use()
     Ray cameraRay = view3D_->GetCameraRay();
     Ray cameraRay = view3D_->GetCameraRay();
     float scale = gizmoNode_->GetScale().x_;
     float scale = gizmoNode_->GetScale().x_;
 
 
-	// Clones an object when it's dragged while holding down Shift
-	bool dragShift = input->GetMouseButtonDown(MOUSEB_LEFT) && input->GetKeyDown(KEY_SHIFT);
+    // Clones an object when it's dragged while holding down Shift
+    bool dragShift = input->GetMouseButtonDown(MOUSEB_LEFT) && input->GetKeyDown(KEY_SHIFT);
+
+    if (dragShift && !cloning_)
+    {
+        cloning_ = true;
+        selection_->Copy();
+        selection_->Paste();
+    }
 
 
-	if (dragShift && !cloning_)
-	{
-		cloning_ = true;
-		selection_->Copy();
-		selection_->Paste();
-	}
-	
     // Recalculate axes only when not left-dragging
     // Recalculate axes only when not left-dragging
     bool drag = input->GetMouseButtonDown(MOUSEB_LEFT);// && (Abs(input->GetMouseMoveX()) > 3 || Abs(input->GetMouseMoveY()) > 3);
     bool drag = input->GetMouseButtonDown(MOUSEB_LEFT);// && (Abs(input->GetMouseMoveX()) > 3 || Abs(input->GetMouseMoveY()) > 3);
     if (!drag)
     if (!drag)
@@ -204,11 +204,8 @@ void Gizmo3D::Use()
             scene_->SendEvent(E_SCENEEDITEND);
             scene_->SendEvent(E_SCENEEDITEND);
             dragging_ = false;
             dragging_ = false;
         }
         }
-		
-		if (cloning_)
-		{
-			cloning_ = false;
-		}
+
+        cloning_ = false;
 
 
         CalculateGizmoAxes();
         CalculateGizmoAxes();
     }
     }

+ 1 - 1
Source/AtomicEditor/Editors/SceneEditor3D/Gizmo3D.h

@@ -184,7 +184,7 @@ private:
     AxisMode axisMode_;
     AxisMode axisMode_;
 
 
     bool dragging_;
     bool dragging_;
-	bool cloning_;
+    bool cloning_;
 
 
     // snap settings
     // snap settings
     float snapTranslationX_;
     float snapTranslationX_;