[longomatch] Clip the drawing area in the Cairo context
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Clip the drawing area in the Cairo context
- Date: Wed, 24 Sep 2014 20:22:11 +0000 (UTC)
commit 45a22db9669478ec605efe4cc7eb89dcf4dc81d7
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Sep 2 15:38:42 2014 +0200
Clip the drawing area in the Cairo context
LongoMatch.Drawing.Cairo/WidgetWrapper.cs | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Drawing.Cairo/WidgetWrapper.cs b/LongoMatch.Drawing.Cairo/WidgetWrapper.cs
index 6b0838f..2b41a5f 100644
--- a/LongoMatch.Drawing.Cairo/WidgetWrapper.cs
+++ b/LongoMatch.Drawing.Cairo/WidgetWrapper.cs
@@ -204,9 +204,13 @@ namespace LongoMatch.Drawing.Cairo
{
if (DrawEvent != null) {
using (CairoContext c = new CairoContext (widget.GdkWindow)) {
+ global::Cairo.Context cc = c.Value as global::Cairo.Context;
if (area == null) {
- area = new Area (new Point (0, 0), Width, Height);
+ Rectangle r = widget.GdkWindow.ClipRegion.Clipbox;
+ area = new Area (new Point (r.X, r.Y), r.Width, r.Height);
}
+ cc.Rectangle (area.Start.X, area.Start.Y, area.Width, area.Height);
+ cc.Clip ();
DrawEvent (c, area);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]