diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-12 13:05:32 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-12 13:05:32 +0100 |
| commit | f1f143775245695a0aaa8cd2538d3b3382f9ea56 (patch) | |
| tree | 0f6ef2fef06cc3254dd0c3b32af38fab8a2e0087 /src/GraphicObjects/GraphicObject.cs | |
| parent | a823099f5db40fb8b2cbe79179185db5266e01e3 (diff) | |
testing clipping rect registration, clear and clip, not working
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 87ac0eef..97e4eccf 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -31,8 +31,8 @@ namespace Crow internal List<Binding> Bindings = new List<Binding> (); internal int layoutingTries = 0; - Rectangles _clipping = new Rectangles(); - public Rectangles Clipping { get { return _clipping; }} + Rectangles clipping = new Rectangles(); + public Rectangles Clipping { get { return clipping; }} #region IValueChange implementation public event EventHandler<ValueChangeEventArgs> ValueChanged; @@ -471,11 +471,10 @@ namespace Crow public virtual bool Contains(GraphicObject goToFind){ return false; } - public void RegisterClip(Rectangle clip){ - Rectangle r = Slot + Parent.ClientRectangle; + public void RegisterClip(Rectangle clip){ if (CacheEnabled && bmp != null) - Clipping.AddRectangle (r); - Parent.RegisterClip (r); + Clipping.AddRectangle (clip); + Parent.RegisterClip (clip + Slot.Position + Parent.ClientRectangle.Position); } // public virtual void registerClipRect(Rectangle clip) // { @@ -768,7 +767,9 @@ namespace Crow // } ctx.SetSourceSurface (cache, rb.X, rb.Y); ctx.Paint (); - } + } + //Clipping.clearAndClip (ctx); + Clipping.Reset(); } /// <summary> Chained painting routine on the parent context of the actual cached version /// of the widget </summary> @@ -793,7 +794,6 @@ namespace Crow Rectangle rb = Slot + Parent.ClientRectangle.Position; ctx.Save (); - //Clipping.clearAndClip (ctx); ctx.Translate (rb.X, rb.Y); onDraw (ctx); |