aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTom Grimshaw2010-07-05 03:58:18 -0700
committerTom Grimshaw2010-07-05 03:58:18 -0700
commitbe5dd04150bae69745de3cf5efde3d5be288dd71 (patch)
treef608f05b59f543458301003cd670f3eeaff2447e /OpenSim
parentFix single prim rotation undo. All UNDO functions are now working correctly ... (diff)
downloadopensim-SC_OLD-be5dd04150bae69745de3cf5efde3d5be288dd71.zip
opensim-SC_OLD-be5dd04150bae69745de3cf5efde3d5be288dd71.tar.gz
opensim-SC_OLD-be5dd04150bae69745de3cf5efde3d5be288dd71.tar.bz2
opensim-SC_OLD-be5dd04150bae69745de3cf5efde3d5be288dd71.tar.xz
Bring "Redo" up to date with "Undo" so it works too
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs41
1 files changed, 10 insertions, 31 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs
index f9601e6..2af3316 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -123,7 +123,7 @@ namespace OpenSim.Region.Framework.Scenes
123 public bool Compare(UndoState undo) 123 public bool Compare(UndoState undo)
124 { 124 {
125 if (undo == null || Position == null) return false; 125 if (undo == null || Position == null) return false;
126 if (undo.Position == Position && undo.Rotation == Rotation && undo.Scale == Scale && undo.GroupPosition == GroupPosition && undo.GroupScale == GroupScale && undo.GroupRotation == GroupRotation) 126 if (undo.Position == Position && undo.Rotation == Rotation && undo.Scale == Scale && undo.GroupPosition == GroupPosition && undo.GroupScale == GroupScale && undo.GroupRotation == GroupRotation)
127 { 127 {
128 return true; 128 return true;
129 } 129 }
@@ -155,7 +155,7 @@ namespace OpenSim.Region.Framework.Scenes
155 return false; 155 return false;
156 } 156 }
157 157
158 public void PlaybackState(SceneObjectPart part) 158 private void RestoreState(SceneObjectPart part)
159 { 159 {
160 bool GroupChange = false; 160 bool GroupChange = false;
161 if ((Type & UndoType.STATE_GROUP_POSITION) != 0 161 if ((Type & UndoType.STATE_GROUP_POSITION) != 0
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Framework.Scenes
172 if (part.ParentID == 0 && GroupChange == false) 172 if (part.ParentID == 0 && GroupChange == false)
173 { 173 {
174 if (Position != Vector3.Zero) 174 if (Position != Vector3.Zero)
175 part.ParentGroup.AbsolutePosition = Position; 175 part.ParentGroup.AbsolutePosition = Position;
176 part.RotationOffset = Rotation; 176 part.RotationOffset = Rotation;
177 if (Scale != Vector3.Zero) 177 if (Scale != Vector3.Zero)
178 part.Resize(Scale); 178 part.Resize(Scale);
@@ -193,7 +193,7 @@ namespace OpenSim.Region.Framework.Scenes
193 part.ParentGroup.GroupResize(gs * scale, part.LocalId); 193 part.ParentGroup.GroupResize(gs * scale, part.LocalId);
194 part.ParentGroup.AbsolutePosition = GroupPosition; 194 part.ParentGroup.AbsolutePosition = GroupPosition;
195 part.ParentGroup.UpdateGroupRotationR(GroupRotation); 195 part.ParentGroup.UpdateGroupRotationR(GroupRotation);
196 196
197 } 197 }
198 part.ParentGroup.RootPart.Undoing = false; 198 part.ParentGroup.RootPart.Undoing = false;
199 } 199 }
@@ -211,35 +211,13 @@ namespace OpenSim.Region.Framework.Scenes
211 211
212 } 212 }
213 } 213 }
214 public void PlaybackState(SceneObjectPart part)
215 {
216 RestoreState(part);
217 }
214 public void PlayfwdState(SceneObjectPart part) 218 public void PlayfwdState(SceneObjectPart part)
215 { 219 {
216 if (part != null) 220 RestoreState(part);
217 {
218 part.Undoing = true;
219
220 if (part.ParentID == 0)
221 {
222 if (Position != Vector3.Zero)
223 part.ParentGroup.AbsolutePosition = Position;
224 if (Rotation != Quaternion.Identity)
225 part.UpdateRotation(Rotation);
226 if (Scale != Vector3.Zero)
227 part.Resize(Scale);
228 part.ParentGroup.ScheduleGroupForTerseUpdate();
229 }
230 else
231 {
232 if (Position != Vector3.Zero)
233 part.OffsetPosition = Position;
234 if (Rotation != Quaternion.Identity)
235 part.UpdateRotation(Rotation);
236 if (Scale != Vector3.Zero)
237 part.Resize(Scale);
238 part.ScheduleTerseUpdate();
239 }
240 part.Undoing = false;
241
242 }
243 } 221 }
244 } 222 }
245 public class LandUndoState 223 public class LandUndoState
@@ -267,3 +245,4 @@ namespace OpenSim.Region.Framework.Scenes
267 } 245 }
268 } 246 }
269} 247}
248