Replace ifs in SOG.GroupResize() with Math.Min()

Also fiddle a bit with undo.  This is not currently working properly, though to be fair it also didn't appear to work in 0.7.1.1 either (at least for resize).
Will get some more attention soon.
bulletsim
Justin Clark-Casey (justincc) 2011-07-16 05:23:21 +01:00
parent 9a80adf33a
commit f5ddf37112
3 changed files with 25 additions and 14 deletions

View File

@ -569,6 +569,7 @@ namespace OpenSim.Region.Framework.Scenes
if (primId != UUID.Zero) if (primId != UUID.Zero)
{ {
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId);
if (part != null) if (part != null)
part.Redo(); part.Redo();
} }

View File

@ -2623,21 +2623,15 @@ namespace OpenSim.Region.Framework.Scenes
RootPart.IgnoreUndoUpdate = true; RootPart.IgnoreUndoUpdate = true;
if (scale.X > m_scene.m_maxNonphys) scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
scale.X = m_scene.m_maxNonphys; scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
if (scale.Y > m_scene.m_maxNonphys) scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys);
scale.Y = m_scene.m_maxNonphys;
if (scale.Z > m_scene.m_maxNonphys)
scale.Z = m_scene.m_maxNonphys;
if (RootPart.PhysActor != null && RootPart.PhysActor.IsPhysical) if (RootPart.PhysActor != null && RootPart.PhysActor.IsPhysical)
{ {
if (scale.X > m_scene.m_maxPhys) scale.X = Math.Min(scale.X, Scene.m_maxPhys);
scale.X = m_scene.m_maxPhys; scale.Y = Math.Min(scale.Y, Scene.m_maxPhys);
if (scale.Y > m_scene.m_maxPhys) scale.Z = Math.Min(scale.Z, Scene.m_maxPhys);
scale.Y = m_scene.m_maxPhys;
if (scale.Z > m_scene.m_maxPhys)
scale.Z = m_scene.m_maxPhys;
} }
float x = (scale.X / RootPart.Scale.X); float x = (scale.X / RootPart.Scale.X);
@ -2715,7 +2709,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
obPart.IgnoreUndoUpdate = false; obPart.IgnoreUndoUpdate = false;
obPart.StoreUndoState();
} }
} }
} }
@ -2753,6 +2746,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
RootPart.IgnoreUndoUpdate = false; RootPart.IgnoreUndoUpdate = false;
RootPart.StoreUndoState(); RootPart.StoreUndoState();
} }

View File

@ -3687,6 +3687,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (m_parentGroup != null) if (m_parentGroup != null)
{ {
// m_log.DebugFormat("[SCENE OBJECT PART]: Storing undo state for {0} {1}", Name, LocalId);
lock (m_undo) lock (m_undo)
{ {
if (m_undo.Count > 0) if (m_undo.Count > 0)
@ -3705,11 +3707,18 @@ namespace OpenSim.Region.Framework.Scenes
m_undo.Push(nUndo); m_undo.Push(nUndo);
} }
} }
} }
} }
// else
// {
// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
// }
} }
// else
// {
// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
// }
} }
public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot) public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot)
@ -4179,11 +4188,14 @@ namespace OpenSim.Region.Framework.Scenes
if (m_undo.Count > 0) if (m_undo.Count > 0)
{ {
UndoState nUndo = null; UndoState nUndo = null;
if (m_parentGroup.GetSceneMaxUndo() > 0) if (m_parentGroup.GetSceneMaxUndo() > 0)
{ {
nUndo = new UndoState(this); nUndo = new UndoState(this);
} }
UndoState goback = m_undo.Pop(); UndoState goback = m_undo.Pop();
if (goback != null) if (goback != null)
{ {
goback.PlaybackState(this); goback.PlaybackState(this);
@ -4196,6 +4208,8 @@ namespace OpenSim.Region.Framework.Scenes
public void Redo() public void Redo()
{ {
// m_log.DebugFormat("[SCENE OBJECT PART]: Handling redo request for {0} {1}", Name, LocalId);
lock (m_redo) lock (m_redo)
{ {
if (m_parentGroup.GetSceneMaxUndo() > 0) if (m_parentGroup.GetSceneMaxUndo() > 0)
@ -4204,7 +4218,9 @@ namespace OpenSim.Region.Framework.Scenes
m_undo.Push(nUndo); m_undo.Push(nUndo);
} }
UndoState gofwd = m_redo.Pop(); UndoState gofwd = m_redo.Pop();
if (gofwd != null) if (gofwd != null)
gofwd.PlayfwdState(this); gofwd.PlayfwdState(this);
} }