From 7884278097d49730606afca20cad60510a70269d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 19 Mar 2019 10:29:48 +0000 Subject: [PATCH] try to avoid some useless full object updates --- .../Region/Framework/Scenes/SceneObjectPart.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 312ce26e4a..edcdbd3512 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1038,8 +1038,8 @@ namespace OpenSim.Region.Framework.Scenes { get { - if (m_text.Length > 256) // yes > 254 - return m_text.Substring(0, 256); + if (m_text.Length > 254) + return m_text.Substring(0, 254); return m_text; } set { m_text = value; } @@ -4004,9 +4004,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void SetText(string text) { - Text = text; + string oldtext = m_text; + m_text = text; - if (ParentGroup != null) + if (ParentGroup != null && oldtext != text) { ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); @@ -4021,11 +4022,18 @@ namespace OpenSim.Region.Framework.Scenes /// public void SetText(string text, Vector3 color, double alpha) { + Color oldcolor = Color; + string oldtext = m_text; Color = Color.FromArgb((int) (alpha*0xff), (int) (color.X*0xff), (int) (color.Y*0xff), (int) (color.Z*0xff)); - SetText(text); + m_text = text; + if(ParentGroup != null && (oldcolor != Color || oldtext != m_text)) + { + ParentGroup.HasGroupChanged = true; + ScheduleFullUpdate(); + } } public void StoreUndoState(ObjectChangeType change)