aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/PrivateContainer.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-12 11:26:52 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-12 11:26:52 +0100
commit83c588a624723742e77db3914259ee37c530bca2 (patch)
treea3a0cf98cfcb4860b430693df01d84fdb4a2bdd3 /src/GraphicObjects/PrivateContainer.cs
parent0f813f1c3d1bc3e4deeee089d771eb0443949e3f (diff)
progressing, not using contextCoord anymore
Diffstat (limited to 'src/GraphicObjects/PrivateContainer.cs')
-rw-r--r--src/GraphicObjects/PrivateContainer.cs59
1 files changed, 43 insertions, 16 deletions
diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs
index 63f4f02a..f3a512d0 100644
--- a/src/GraphicObjects/PrivateContainer.cs
+++ b/src/GraphicObjects/PrivateContainer.cs
@@ -133,30 +133,57 @@ namespace Crow
break;
}
}
-
- public override Rectangle ContextCoordinates (Rectangle r)
+ protected override void onDraw (Context gr)
{
- return
- Parent.ContextCoordinates(r) + Slot.Position + ClientRectangle.Position;
+ base.onDraw (gr);
+ if (child != null)
+ child.Paint (ref gr);
}
- public override void Paint(ref Cairo.Context ctx)
+ protected override void UpdateCache (Context ctx)
{
- if (!Visible)//check if necessary??
- return;
-
- ctx.Save();
+ Rectangle rb = Slot + Parent.ClientRectangle.Position;
- base.Paint(ref ctx);
+ using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
+ Context gr = new Context (cache);
- //clip to client zone
- CairoHelpers.CairoRectangle (ctx, Parent.ContextCoordinates(ClientRectangle + Slot.Position), CornerRadius);
- ctx.Clip();
+ child.Clipping.clearAndClip (gr);
+ base.onDraw (gr);
- if (child != null)
- child.Paint(ref ctx);
+ if (Clipping.count > 0) {
+ if (child != null) {
+ child.Paint (ref gr);
+ }
+ }
+
+ gr.Dispose ();
- ctx.Restore();
+ ctx.SetSourceSurface (cache, rb.X, rb.Y);
+ ctx.Paint ();
+ }
}
+// public override Rectangle ContextCoordinates (Rectangle r)
+// {
+// return
+// Parent.ContextCoordinates(r) + Slot.Position + ClientRectangle.Position;
+// }
+// public override void Paint(ref Cairo.Context ctx)
+// {
+// if (!Visible)//check if necessary??
+// return;
+//
+// ctx.Save();
+//
+// base.Paint(ref ctx);
+//
+// //clip to client zone
+// CairoHelpers.CairoRectangle (ctx, Parent.ContextCoordinates(ClientRectangle + Slot.Position), CornerRadius);
+// ctx.Clip();
+//
+// if (child != null)
+// child.Paint(ref ctx);
+//
+// ctx.Restore();
+// }
#endregion