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.
bulletsim
Justin Clark-Casey (justincc) 2011-07-19 05:46:17 +01:00
parent 0ef29da9b2
commit bc3679b67d
3 changed files with 11 additions and 9 deletions

View File

@ -2825,6 +2825,7 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
part.StoreUndoState(false);
part.IgnoreUndoUpdate = true;
if (part.UUID == m_rootPart.UUID)
{
@ -2836,6 +2837,7 @@ namespace OpenSim.Region.Framework.Scenes
}
HasGroupChanged = true;
part.IgnoreUndoUpdate = false;
}
}
@ -2848,9 +2850,9 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
parts[i].StoreUndoState();
// SceneObjectPart[] parts = m_parts.GetArray();
// for (int i = 0; i < parts.Length; i++)
// parts[i].StoreUndoState();
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
Vector3 oldPos =
@ -2863,7 +2865,7 @@ namespace OpenSim.Region.Framework.Scenes
axDiff *= Quaternion.Inverse(partRotation);
diff = axDiff;
parts = m_parts.GetArray();
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart obPart = parts[i];

View File

@ -788,7 +788,7 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_offsetPosition; }
set
{
StoreUndoState();
// StoreUndoState();
m_offsetPosition = value;
if (ParentGroup != null && !ParentGroup.IsDeleted)

View File

@ -59,10 +59,10 @@ namespace OpenSim.Region.Framework.Scenes
{
ForGroup = forGroup;
if (ForGroup)
// if (ForGroup)
Position = part.ParentGroup.AbsolutePosition;
else
Position = part.OffsetPosition;
// else
// Position = part.OffsetPosition;
// m_log.DebugFormat(
// "[UNDO STATE]: Storing undo position {0} for root part", Position);
@ -143,7 +143,7 @@ namespace OpenSim.Region.Framework.Scenes
if (ForGroup)
part.ParentGroup.AbsolutePosition = Position;
else
part.OffsetPosition = Position;
part.ParentGroup.UpdateRootPosition(Position);
}
// m_log.DebugFormat(