Author: lewing
Date: 2007-11-20 21:42:20 -0500 (Tue, 20 Nov 2007)
New Revision: 90059

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/runtime.cpp
Log:
2007-11-20  Larry Ewing  <[EMAIL PROTECTED]>

        * runtime.cpp (Surface::expose_event_callback): take allocation
        offsets into account when invalidating and drawing.  Fixes
        bug 339010.


Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-11-21 01:56:10 UTC (rev 90058)
+++ trunk/moon/src/ChangeLog    2007-11-21 02:42:20 UTC (rev 90059)
@@ -1,3 +1,9 @@
+2007-11-20  Larry Ewing  <[EMAIL PROTECTED]>
+
+       * runtime.cpp (Surface::expose_event_callback): take allocation
+       offsets into account when invalidating and drawing.  Fixes
+       #339010.
+
 2007-11-20  Chris Toshok  <[EMAIL PROTECTED]>
 
        * xaml.cpp (XamlElementInstance::ClearSetProperties): in glib <

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2007-11-21 01:56:10 UTC (rev 90058)
+++ trunk/moon/src/runtime.cpp  2007-11-21 02:42:20 UTC (rev 90059)
@@ -404,7 +404,8 @@
 Surface::Invalidate (Rect r)
 {
        gtk_widget_queue_draw_area (drawing_area,
-                                   (int) r.x, (int)r.y, 
+                                   (int) drawing_area->allocation.x + r.x, 
+                                   (int) drawing_area->allocation.y + r.y, 
                                    (int) r.w, (int)r.h);
 }
 
@@ -800,10 +801,14 @@
 #endif
        GdkPixmap *pixmap = gdk_pixmap_new (widget->window, MAX 
(event->area.width, 1), MAX (event->area.height, 1), -1);
        cairo_t *ctx = runtime_cairo_create (pixmap);
+       Region *region = new Region (event->region);
+       gdk_region_offset (region->gdkregion, -widget->allocation.x, 
-widget->allocation.y);
+
        cairo_surface_set_device_offset (cairo_get_target (ctx),
-                                        -event->area.x, - event->area.y);
+                                        widget->allocation.x - event->area.x, 
+                                        widget->allocation.y - event->area.y);
 
-       runtime_cairo_region (ctx, event->region);
+       runtime_cairo_region (ctx, region->gdkregion);
        cairo_clip (ctx);
 
        //
@@ -842,11 +847,10 @@
 
        cairo_save (ctx);
        cairo_set_operator (ctx, CAIRO_OPERATOR_OVER);
-       Region *region = new Region (event->region);
        s->Paint (ctx, region);
        delete (region);
 #if DEBUG_EXPOSE
-       runtime_cairo_region (ctx, event->region);
+       runtime_cairo_region (ctx, region->gdkregion);
        cairo_set_line_width (ctx, 2.0);
        cairo_set_source_rgb (ctx, (double)(s->frames % 2), (double)((s->frames 
+ 1) % 2), (double)((s->frames / 3) % 2));
        cairo_stroke (ctx);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to