[gnome-builder] snippets: use gdk_rectangle_union() to draw snippet background.



commit a2a74071f9ddb50cddd3a340774f59643916163b
Author: Christian Hergert <christian hergert me>
Date:   Mon Sep 8 12:20:08 2014 -0700

    snippets: use gdk_rectangle_union() to draw snippet background.

 src/editor/gb-source-view.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/src/editor/gb-source-view.c b/src/editor/gb-source-view.c
index 85d9509..d393f48 100644
--- a/src/editor/gb-source-view.c
+++ b/src/editor/gb-source-view.c
@@ -186,19 +186,11 @@ get_rect_for_iters (GtkTextView       *text_view,
   do
     {
       gtk_text_view_get_iter_location (text_view, &iter, &tmp);
-
-      area.x = MIN (area.x, tmp.x);
-      area.y = MIN (area.y, tmp.y);
-      area.width = MAX (area.width, (tmp.x + tmp.width) - area.x);
-      area.height = MAX (area.height, (tmp.y + tmp.height) - area.y);
+      gdk_rectangle_union (&area, &tmp, &area);
 
       gtk_text_iter_forward_to_line_end (&iter);
       gtk_text_view_get_iter_location (text_view, &iter, &tmp);
-
-      area.x = MIN (area.x, tmp.x);
-      area.y = MIN (area.y, tmp.y);
-      area.width = MAX (area.width, (tmp.x + tmp.width) - area.x);
-      area.height = MAX (area.height, (tmp.y + tmp.height) - area.y);
+      gdk_rectangle_union (&area, &tmp, &area);
 
       if (!gtk_text_iter_forward_char (&iter))
         break;


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