aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-19 05:46:17 +0100
committerJustin Clark-Casey (justincc)2011-07-19 05:46:17 +0100
commitbc3679b67dc074a9ef1e0e6ffb07bca844eb93c9 (patch)
tree84818e8bf78d0f82d783b9ca94f29e5788198067 /OpenSim/Region/Framework/Scenes
parentrefactor: rename UpdatePrimPosition() to UpdatePrimGroupPosition() for consis... (diff)
downloadopensim-SC_OLD-bc3679b67dc074a9ef1e0e6ffb07bca844eb93c9.zip
opensim-SC_OLD-bc3679b67dc074a9ef1e0e6ffb07bca844eb93c9.tar.gz
opensim-SC_OLD-bc3679b67dc074a9ef1e0e6ffb07bca844eb93c9.tar.bz2
opensim-SC_OLD-bc3679b67dc074a9ef1e0e6ffb07bca844eb93c9.tar.xz
Fix undo when changing just the root prim's position in a linkset.
I think (ha ha) this largely fixes undo, except for the fact that rotation a set of prims with 'edit linked parts' selected doesn't quite work properly (though this works fine if the checkbox isn't selected). Also, the double undo bug for resize is still present. Redo might be incredibly buggy, haven't even looked at that yet.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs8
3 files changed, 11 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 26b35a3..b6fb5a4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2825,6 +2825,7 @@ namespace OpenSim.Region.Framework.Scenes
2825// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos); 2825// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
2826 2826
2827 part.StoreUndoState(false); 2827 part.StoreUndoState(false);
2828 part.IgnoreUndoUpdate = true;
2828 2829
2829 if (part.UUID == m_rootPart.UUID) 2830 if (part.UUID == m_rootPart.UUID)
2830 { 2831 {
@@ -2836,6 +2837,7 @@ namespace OpenSim.Region.Framework.Scenes
2836 } 2837 }
2837 2838
2838 HasGroupChanged = true; 2839 HasGroupChanged = true;
2840 part.IgnoreUndoUpdate = false;
2839 } 2841 }
2840 } 2842 }
2841 2843
@@ -2848,9 +2850,9 @@ namespace OpenSim.Region.Framework.Scenes
2848// m_log.DebugFormat( 2850// m_log.DebugFormat(
2849// "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos); 2851// "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos);
2850 2852
2851 SceneObjectPart[] parts = m_parts.GetArray(); 2853// SceneObjectPart[] parts = m_parts.GetArray();
2852 for (int i = 0; i < parts.Length; i++) 2854// for (int i = 0; i < parts.Length; i++)
2853 parts[i].StoreUndoState(); 2855// parts[i].StoreUndoState();
2854 2856
2855 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); 2857 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
2856 Vector3 oldPos = 2858 Vector3 oldPos =
@@ -2863,7 +2865,7 @@ namespace OpenSim.Region.Framework.Scenes
2863 axDiff *= Quaternion.Inverse(partRotation); 2865 axDiff *= Quaternion.Inverse(partRotation);
2864 diff = axDiff; 2866 diff = axDiff;
2865 2867
2866 parts = m_parts.GetArray(); 2868 SceneObjectPart[] parts = m_parts.GetArray();
2867 for (int i = 0; i < parts.Length; i++) 2869 for (int i = 0; i < parts.Length; i++)
2868 { 2870 {
2869 SceneObjectPart obPart = parts[i]; 2871 SceneObjectPart obPart = parts[i];
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 0357cf9..9d7f87a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -788,7 +788,7 @@ namespace OpenSim.Region.Framework.Scenes
788 get { return m_offsetPosition; } 788 get { return m_offsetPosition; }
789 set 789 set
790 { 790 {
791 StoreUndoState(); 791// StoreUndoState();
792 m_offsetPosition = value; 792 m_offsetPosition = value;
793 793
794 if (ParentGroup != null && !ParentGroup.IsDeleted) 794 if (ParentGroup != null && !ParentGroup.IsDeleted)
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs
index b013d68..6bf89c5 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -59,10 +59,10 @@ namespace OpenSim.Region.Framework.Scenes
59 { 59 {
60 ForGroup = forGroup; 60 ForGroup = forGroup;
61 61
62 if (ForGroup) 62// if (ForGroup)
63 Position = part.ParentGroup.AbsolutePosition; 63 Position = part.ParentGroup.AbsolutePosition;
64 else 64// else
65 Position = part.OffsetPosition; 65// Position = part.OffsetPosition;
66 66
67// m_log.DebugFormat( 67// m_log.DebugFormat(
68// "[UNDO STATE]: Storing undo position {0} for root part", Position); 68// "[UNDO STATE]: Storing undo position {0} for root part", Position);
@@ -143,7 +143,7 @@ namespace OpenSim.Region.Framework.Scenes
143 if (ForGroup) 143 if (ForGroup)
144 part.ParentGroup.AbsolutePosition = Position; 144 part.ParentGroup.AbsolutePosition = Position;
145 else 145 else
146 part.OffsetPosition = Position; 146 part.ParentGroup.UpdateRootPosition(Position);
147 } 147 }
148 148
149// m_log.DebugFormat( 149// m_log.DebugFormat(