summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/defines.h2
-rw-r--r--common/project.cpp15
2 files changed, 10 insertions, 7 deletions
diff --git a/common/defines.h b/common/defines.h
index f871c6f..e5cd818 100644
--- a/common/defines.h
+++ b/common/defines.h
@@ -155,7 +155,7 @@ int stricmp(const char* str1, const char* str2);
#define LC_DRAW_SNAP_Y 0x0010 // Snap Y
#define LC_DRAW_SNAP_Z 0x0020 // Snap Z
#define LC_DRAW_SNAP_XYZ (LC_DRAW_SNAP_X | LC_DRAW_SNAP_Y | LC_DRAW_SNAP_Z)
-#define LC_DRAW_SNAP_GRID 0x0040 // Snap to grid (world coordinates)
+#define LC_DRAW_GLOBAL_SNAP 0x0040 // Don't allow relative snap.
#define LC_DRAW_MOVE 0x0080 // Switch to move after insert
#define LC_DRAW_LOCK_X 0x0100 // Lock X
#define LC_DRAW_LOCK_Y 0x0200 // Lock Y
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();