[gimp] app: simplify some GimpDisplayShell drawing code



commit a6d7542c56205678530f6c32aa9698d50980ed35
Author: Michael Natterer <mitch gimp org>
Date:   Wed Aug 11 15:00:27 2010 +0200

    app: simplify some GimpDisplayShell drawing code

 app/display/gimpdisplayshell-draw.c |   42 +++++++++++++---------------------
 1 files changed, 16 insertions(+), 26 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index 0a72ca3..2f9b50f 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -202,27 +202,22 @@ gimp_display_shell_draw_guides (GimpDisplayShell *shell,
       GdkRectangle  area;
       GList        *list;
 
-      if (region)
-        {
-          gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
-                                       GIMP_CANVAS_STYLE_GUIDE_NORMAL,
-                                       region);
-          gdk_region_get_clipbox (region, &area);
-        }
+      gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
+                                   GIMP_CANVAS_STYLE_GUIDE_NORMAL,
+                                   region);
+      gdk_region_get_clipbox (region, &area);
 
       for (list = gimp_image_get_guides (image);
            list;
            list = g_list_next (list))
         {
           gimp_display_shell_draw_guide (shell, list->data,
-                                         region ? &area : NULL,
-                                         FALSE);
+                                         &area, FALSE);
         }
 
-      if (region)
-        gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
-                                     GIMP_CANVAS_STYLE_GUIDE_NORMAL,
-                                     NULL);
+      gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
+                                   GIMP_CANVAS_STYLE_GUIDE_NORMAL,
+                                   NULL);
     }
 }
 
@@ -545,27 +540,22 @@ gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
       GdkRectangle  area;
       GList        *list;
 
-      if (region)
-        {
-          gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
-                                       GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
-                                       region);
-          gdk_region_get_clipbox (region, &area);
-        }
+      gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
+                                   GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
+                                   region);
+      gdk_region_get_clipbox (region, &area);
 
       for (list = gimp_image_get_sample_points (image);
            list;
            list = g_list_next (list))
         {
           gimp_display_shell_draw_sample_point (shell, list->data,
-                                                region ? &area : NULL,
-                                                FALSE);
+                                                &area, FALSE);
         }
 
-      if (region)
-        gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
-                                     GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
-                                     region);
+      gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
+                                   GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
+                                   NULL);
     }
 }
 



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