summaryrefslogtreecommitdiff
path: root/common/project.cpp
diff options
context:
space:
mode:
authorleo2006-03-06 01:17:19 +0000
committerleo2006-03-06 01:17:19 +0000
commit7803446ca9074a258ca0184aa9c317c47e2b8523 (patch)
tree16cb04c7233fefa46d517dc5a5b0fff3171ae3bb /common/project.cpp
parent5313b0d1b2cf4a803d25faa80b6d7b697f046634 (diff)
Added an option to disable relative snap.
git-svn-id: http://svn.leocad.org/trunk@516 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/project.cpp')
-rw-r--r--common/project.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/common/project.cpp b/common/project.cpp
index 035726a..890bbee 100644
--- a/common/project.cpp
+++ b/common/project.cpp
@@ -2238,7 +2238,7 @@ void Project::RenderOverlays(int Viewport)
Object* Focus = NULL;
float Rot[4];
- if ((m_nSnap & LC_DRAW_SNAP_GRID) == 0)
+ if ((m_nSnap & LC_DRAW_GLOBAL_SNAP) == 0)
{
Focus = GetFocusObject();
@@ -2348,7 +2348,7 @@ void Project::RenderOverlays(int Viewport)
Object* Focus = NULL;
float Rot[4];
- if ((m_nSnap & LC_DRAW_SNAP_GRID) == 0)
+ if ((m_nSnap & LC_DRAW_GLOBAL_SNAP) == 0)
{
Focus = GetFocusObject();
@@ -7270,7 +7270,7 @@ bool Project::MoveSelectedObjects(Vector3& Move, Vector3& Remainder)
return false;
// Transform the translation if we're in relative mode.
- if ((m_nSnap & LC_DRAW_SNAP_GRID) == 0)
+ if ((m_nSnap & LC_DRAW_GLOBAL_SNAP) == 0)
{
Object* Focus = GetFocusObject();
@@ -7401,6 +7401,9 @@ bool Project::RotateSelectedObjects(Vector3& Delta, Vector3& Remainder)
}
// Transform the rotation relative to the focused piece.
+ if (m_nSnap & LC_DRAW_GLOBAL_SNAP)
+ pFocus = NULL;
+
if (pFocus != NULL)
{
float Rot[4];
@@ -8561,7 +8564,7 @@ void Project::OnMouseMove(int x, int y, bool bControl, bool bShift)
Vector3 Axis1 = Dir1;
Vector3 Axis2 = Dir2;
- if ((m_nSnap & LC_DRAW_SNAP_GRID) == 0)
+ if ((m_nSnap & LC_DRAW_GLOBAL_SNAP) == 0)
{
Object* Focus = GetFocusObject();
@@ -8996,7 +8999,7 @@ void Project::MouseUpdateOverlays(int x, int y)
};
// Find the rotation from the focused piece if relative snap is enabled.
- if ((m_nSnap & LC_DRAW_SNAP_GRID) == 0)
+ if ((m_nSnap & LC_DRAW_GLOBAL_SNAP) == 0)
{
Object* Focus = GetFocusObject();
@@ -9165,7 +9168,7 @@ void Project::MouseUpdateOverlays(int x, int y)
continue;
// Find the rotation from the focused piece if relative snap is enabled.
- if ((m_nSnap & LC_DRAW_SNAP_GRID) == 0)
+ if ((m_nSnap & LC_DRAW_GLOBAL_SNAP) == 0)
{
Object* Focus = GetFocusObject();