2005-10-09 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Sun, 9 Oct 2005 21:19:30 +0000 (21:19 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sun, 9 Oct 2005 21:19:30 +0000 (21:19 -0000)
* Samples/gtk/sysdraw.cs: Fix the sample

svn path=/trunk/mcs/; revision=51498

mcs/class/Mono.Cairo/ChangeLog
mcs/class/Mono.Cairo/Samples/gtk/sysdraw.cs

index 134b1bac8204db865afab700616b67fefde77d0c..f49f13939c588d7665e2c6fff4139f9830c5ae8d 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-09  Miguel de Icaza  <miguel@novell.com>
+
+       * Samples/gtk/sysdraw.cs: Fix the sample
+       
+
 2005-09-19  John Luke  <john.luke@gmail.com>
 
        * Mono.Cairo/Graphics.cs: add SelectFontFace and SetFontSize
index ddd682c256b54e63331a372509130c4095043721..81c0155c30c94ba16e197b793128578f5d185c36 100644 (file)
@@ -59,10 +59,11 @@ namespace Gdk
                        
                        int x, y, w, h, d;
                        ((Gdk.Window)drawable).GetGeometry(out x, out y, out w, out h, out d);
-                       
-                       if (drawable is Gdk.Window)
-                         ((Gdk.Window) drawable).GetInternalPaintInfo(out drawable, 
-                                                                   out x_off, out y_off);
+
+                       bool is_gdk_window = drawable is Gdk.Window;
+                       if (is_gdk_window)
+                               ((Gdk.Window) drawable).GetInternalPaintInfo(out drawable, 
+                                                                            out x_off, out y_off);
                        
                        x_drawable = drawable.Handle;                   
                        IntPtr visual = gdk_drawable_get_visual(x_drawable);
@@ -82,8 +83,8 @@ namespace Gdk
                        //Cairo.Graphics g = new Cairo.Graphics (
                        //                    gdk_cairo_create (x_drawable ));
                        
-                       if (drawable is Gdk.Window)
-                         g.Translate (-(double)x_off,-(double)y_off);
+                       if (is_gdk_window)
+                               g.Translate (-(double)x_off,-(double)y_off);
                        return g;
                }
        }