[gimp] app: fishes now explode undeprecated



commit 6493020790772dee78da6c76aef1e46baef30334
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 23 12:19:40 2018 +0200

    app: fishes now explode undeprecated

 app/dialogs/lebl-dialog.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/app/dialogs/lebl-dialog.c b/app/dialogs/lebl-dialog.c
index 2f41355..7c21259 100644
--- a/app/dialogs/lebl-dialog.c
+++ b/app/dialogs/lebl-dialog.c
@@ -177,13 +177,26 @@ inv_queue_draw (GtkWidget *window)
 static void
 inv_draw_explosion (int x, int y)
 {
+        GdkDrawingContext *context;
+        cairo_rectangle_int_t rect;
+        cairo_region_t *region;
         cairo_t *cr;
         int i;
 
         if ( ! gtk_widget_is_drawable (geginv_canvas))
                 return;
 
-        cr = gdk_cairo_create ( gtk_widget_get_window (geginv_canvas));
+        rect.x      = x - 100;
+        rect.y      = y - 100;
+        rect.width  = 200;
+        rect.height = 200;
+
+        region = cairo_region_create_rectangle (&rect);
+        context = gdk_window_begin_draw_frame (gtk_widget_get_window (geginv_canvas),
+                                               region);
+        cairo_region_destroy (region);
+
+        cr = gdk_drawing_context_get_cairo_context (context);
 
         cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
 
@@ -203,7 +216,8 @@ inv_draw_explosion (int x, int y)
                 g_usleep (50000);
         }
 
-        cairo_destroy (cr);
+        gdk_window_end_draw_frame (gtk_widget_get_window (geginv_canvas),
+                                   context);
 
        inv_queue_draw (geginv);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]