more changes on undo/redo group scaling seems to work better

avinationmerge
UbitUmarov 2012-03-09 02:56:14 +00:00
parent 05cdf9bda9
commit e5786ba043
2 changed files with 9 additions and 14 deletions

View File

@ -11760,7 +11760,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
case 0x1D: // (UNIFORM + GROUP + SCALE + POS) case 0x1D: // (UNIFORM + GROUP + SCALE + POS)
apos = new Vector3(block.Data, 0); apos = new Vector3(block.Data, 0);
Vector3 scale5 = new Vector3(block.Data, 12); ascale = new Vector3(block.Data, 12);
handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
@ -11770,7 +11770,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
part.StoreUndoState(true); part.StoreUndoState(true);
part.IgnoreUndoUpdate = true; part.IgnoreUndoUpdate = true;
handlerUpdatePrimGroupScale(localId, scale5, this); handlerUpdatePrimGroupScale(localId, ascale, this);
handlerUpdateVector = OnUpdatePrimGroupPosition; handlerUpdateVector = OnUpdatePrimGroupPosition;
if (handlerUpdateVector != null) if (handlerUpdateVector != null)

View File

@ -74,14 +74,11 @@ namespace OpenSim.Region.Framework.Scenes
ForGroup = forGroup; ForGroup = forGroup;
Position = part.ParentGroup.AbsolutePosition; Position = part.ParentGroup.AbsolutePosition;
Rotation = part.RotationOffset; Rotation = part.RotationOffset;
if (!forGroup)
Scale = part.Shape.Scale; Scale = part.Shape.Scale;
else
Scale = Vector3.Zero; // until we fix it
} }
else else
{ {
ForGroup = false; // previus code implies only root parts can undo grp ForGroup = false; // only root parts can undo grp
Position = part.OffsetPosition; Position = part.OffsetPosition;
Rotation = part.RotationOffset; Rotation = part.RotationOffset;
Scale = part.Shape.Scale; Scale = part.Shape.Scale;
@ -108,9 +105,7 @@ namespace OpenSim.Region.Framework.Scenes
return false; return false;
if (Rotation != part.RotationOffset) if (Rotation != part.RotationOffset)
return false; return false;
if (ForGroup) return Scale == part.Shape.Scale;
return true; // for now don't do grp scale
return (Scale == part.Shape.Scale);
} }
else else
{ {
@ -144,10 +139,9 @@ namespace OpenSim.Region.Framework.Scenes
if (Scale != Vector3.Zero) if (Scale != Vector3.Zero)
{ {
// if (ForGroup) if (ForGroup)
// part.ParentGroup.GroupResize(Scale); part.ParentGroup.GroupResize(Scale);
// else else
if (!ForGroup) // we don't have grp scale for now
part.Resize(Scale); part.Resize(Scale);
} }
part.ParentGroup.ScheduleGroupForTerseUpdate(); part.ParentGroup.ScheduleGroupForTerseUpdate();