]> O.S.I.I.S - jp/crow.git/commitdiff
prevent children of uncached group to register for drawing (thats not saving so much...
authorjpbruyere <jp.bruyere@hotmail.com>
Thu, 4 Feb 2016 18:05:51 +0000 (19:05 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Thu, 4 Feb 2016 18:05:51 +0000 (19:05 +0100)
src/GraphicObjects/GraphicObject.cs

index 1a608f36031402560cfc0ce7250af1401385421a..6fe3a40459e2b8abe366b4f82026358ffafb8aa6 100644 (file)
@@ -125,8 +125,6 @@ namespace Crow
                                Parent.ContextCoordinates (r);// + ClientRectangle.Position;
                }                       
                public virtual Rectangle ScreenCoordinates (Rectangle r){
-                       //r += Slot.Position;
-
                        return 
                                Parent.ScreenCoordinates(r) + Parent.getSlot().Position + Parent.ClientRectangle.Position;
                }
@@ -451,14 +449,19 @@ namespace Crow
                public virtual void registerForGraphicUpdate ()
                {
                        bmp = null;
-                       if (HostContainer != null)
-                               HostContainer.gobjsToRedraw.Add (this);
+                       RegisterForRedraw ();
                }
                /// <summary>
                /// Add clipping region in redraw list of interface, dont update cached object content
                /// </summary>
                public virtual void RegisterForRedraw ()
                {
+                       //test if this speed up a lot to cancel clipping for an uncached group
+                       Group p = Parent as Group;
+                       if (p != null) {
+                               if (p.bmp == null)
+                                       return;
+                       }
                        if (HostContainer != null)
                                HostContainer.gobjsToRedraw.Add (this);
                }