aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GraphicObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
-rw-r--r--src/GraphicObjects/GraphicObject.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index b9b142c0..140e5917 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -79,6 +79,7 @@ namespace Crow
HorizontalAlignment _horizontalAlignment = HorizontalAlignment.Center;
Size _maximumSize = "0;0";
Size _minimumSize = "0;0";
+ bool isRegisteredForRepaint = false;
#endregion
#region public fields
@@ -459,11 +460,16 @@ namespace Crow
//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)
+ if (p.bmp == null || !p.Caching) {
+ p.RegisterForRedraw ();
return;
+ }
}
- if (HostContainer != null)
- HostContainer.gobjsToRedraw.Add (this);
+ if (HostContainer == null || isRegisteredForRepaint)
+ return;
+
+ HostContainer.gobjsToRedraw.Add (this);
+ isRegisteredForRepaint = true;
}
/// <summary>
@@ -485,6 +491,7 @@ namespace Crow
//this clipping should take only last painted slots in ancestor tree which
//is not the case for now.
HostContainer.redrawClip.AddRectangle (ScreenCoordinates(LastPaintedSlot));
+ isRegisteredForRepaint = false;
}
/// <summary> return size of content + margins </summary>
protected virtual Size measureRawSize ()