mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Fix undo for resizing linksets
This involves implementing a boolean in UndoState to signal whether the undo needs to be done for an entire group/linkset or just a single prim Resizing individual components of linksets is still dodgy. Resizing still has to be down twice, since for some reason the client is sending two multiobjectupdate packets on every resize except the very first. This applies to single prims and linksets. Need to look into this.
This commit is contained in:
@@ -41,11 +41,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public Vector3 Scale = Vector3.Zero;
|
||||
public Quaternion Rotation = Quaternion.Identity;
|
||||
|
||||
/// <summary>
|
||||
/// Is this undo state for an entire group?
|
||||
/// </summary>
|
||||
public bool ForGroup;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="part"></param>
|
||||
public UndoState(SceneObjectPart part)
|
||||
/// <param name="forGroup">True if the undo is for an entire group</param>
|
||||
public UndoState(SceneObjectPart part, bool forGroup)
|
||||
{
|
||||
if (part != null)
|
||||
{
|
||||
@@ -62,6 +68,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// m_log.DebugFormat(
|
||||
// "[UNDO STATE]: Storing undo scale {0} for root part", part.Shape.Scale);
|
||||
Scale = part.Shape.Scale;
|
||||
|
||||
ForGroup = forGroup;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,7 +149,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// "[UNDO STATE]: Undoing scale {0} to {1} for root part {2} {3}",
|
||||
// part.Shape.Scale, Scale, part.Name, part.LocalId);
|
||||
|
||||
part.Resize(Scale);
|
||||
if (ForGroup)
|
||||
part.ParentGroup.GroupResize(Scale);
|
||||
else
|
||||
part.Resize(Scale);
|
||||
}
|
||||
|
||||
part.ParentGroup.ScheduleGroupForTerseUpdate();
|
||||
@@ -194,7 +205,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
part.UpdateRotation(Rotation);
|
||||
|
||||
if (Scale != Vector3.Zero)
|
||||
part.Resize(Scale);
|
||||
{
|
||||
if (ForGroup)
|
||||
part.ParentGroup.GroupResize(Scale);
|
||||
else
|
||||
part.Resize(Scale);
|
||||
}
|
||||
|
||||
part.ParentGroup.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
@@ -241,4 +257,4 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_terrainModule.UndoTerrain(m_terrainChannel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user